Skip to content
Everyday Utilities Free • No signup • Instant results

JSON to CSV Converter

Convert JSON arrays to downloadable CSV format.

About the JSON to CSV Converter

The JSON to CSV Converter transforms a JSON array of objects into a flat CSV (comma-separated values) file that opens cleanly in Excel, Google Sheets, Numbers, or any spreadsheet program. CSV is the universal interchange format for tabular data — simpler than JSON, smaller than XLSX, and readable by virtually every data tool ever made. Converting from JSON to CSV is what you do when you need to share data with non-developers or import it into a spreadsheet for analysis.

The conversion is not always straightforward. JSON objects can be nested (an address field that is itself an object), can contain arrays (a list of tags), and can have inconsistent keys across rows (one object has a phone field, another does not). A good converter handles all of these gracefully: it collects every unique key across all objects as the column set, fills missing values with empty strings, and serializes nested objects as JSON strings within the CSV cell.

This tool does all of that, plus gives you control over the delimiter (comma, semicolon, tab, or pipe — important for European locales where comma is the decimal separator), whether to include a header row, and whether to quote every field (some legacy systems require this) or only fields that actually need quoting.

How It Works

The tool first parses the JSON input using JSON.parse. If the result is not an array, it errors out — CSV makes sense only for tabular data, and a single object or a primitive cannot be flattened meaningfully. If the array is empty, it also errors.

Then it collects the union of all keys across every object in the array using [...new Set(arr.flatMap(o => Object.keys(o)))]. This handles objects with inconsistent keys: if object 1 has keys A and B, and object 2 has keys B and C, the resulting CSV will have columns A, B, C. Missing values become empty strings.

For each value, the tool checks whether quoting is needed. A field needs quotes if: it contains the delimiter character, it contains a double quote, it contains a newline, or the “quote all” option is enabled. When quoting, embedded double quotes are escaped by doubling them (""), per the CSV specification (RFC 4180). Nested objects and arrays are serialized using JSON.stringify and placed in the cell as a quoted JSON string.

Worked Examples

The default input is a 3-row array of person objects with keys name, age, and city. Converting with default options produces a 4-line CSV: a header row (name,age,city) followed by three data rows. The file opens cleanly in Excel or Google Sheets, with each field in its own cell and each person on their own row.

If you change the delimiter to semicolon and enable “quote all,” every field gets wrapped in double quotes — useful when importing into Excel on a European locale where the system uses commas as decimal separators and semicolons as the default CSV delimiter.

For a more complex input with nested objects — like [{"name":"John","address":{"city":"NYC","zip":"10001"}}] — the converter produces a CSV with columns name and address, where the address cell contains the string {"city":"NYC","zip":"10001"} (properly quoted). To flatten nested objects into separate columns (name, address.city, address.zip), you would need a more specialized flattening tool that walks the object tree and generates dotted-path column names.

When to Use This Tool

  • Exporting API responses to Excel for business analysis.
  • Converting MongoDB query results to CSV for import into a BI tool.
  • Preparing data for upload to email marketing platforms (Mailchimp, SendGrid) that require CSV.
  • Generating CSV downloads from a JSON-backed web application.
  • Sharing data with non-technical colleagues who cannot read JSON.
  • Importing JSON data into SQLite or PostgreSQL via CSV intermediate files.
  • Archiving JSON API responses as flat files for long-term storage.

Limitations & Disclaimer

This tool does not flatten nested objects into separate columns — nested values are serialized as JSON strings within the cell. It does not handle JSON Lines (.jsonl) input directly (each line must be a separate object in a JSON array). It does not escape the BOM (byte order mark) which some Excel versions require for UTF-8 detection. The delimiter is the same for all rows; you cannot mix delimiters. Large arrays (over ~100k rows) may cause browser performance issues. See our disclaimer for full terms.

Frequently Asked Questions

What happens to nested objects or arrays?

Nested objects and arrays are serialized to JSON strings and placed in the CSV cell with proper quoting. For example, an address field that is an object becomes the string <code>{&quot;city&quot;:&quot;NYC&quot;}</code> in the CSV. To flatten nested objects into separate columns, you need a tool that walks the object tree and generates dotted-path column names &mdash; this tool does not do that.

What if my JSON objects have different keys?

The tool collects the union of all keys across all objects and uses them as columns. Missing values become empty cells. So if one object has a &ldquo;phone&rdquo; field and another does not, both will have a phone column; the second object's phone cell will be empty.

Why does my CSV look wrong when I open it in Excel?

Excel uses your system locale to determine the CSV delimiter. In European locales, Excel expects semicolons. If your CSV uses commas, Excel may put everything in one column. Change the delimiter to semicolon in this tool, or use Excel's &ldquo;Text to Columns&rdquo; feature to specify the delimiter manually.

How are commas inside field values handled?

If a field value contains the delimiter character, the tool wraps the entire field in double quotes. If it contains a double quote, the quote is escaped by doubling it (per RFC 4180). So a value like <code>Hello, &quot;World&quot;</code> becomes <code>&quot;Hello, &quot;&quot;World&quot;&quot;&quot;</code> in the CSV.

Is there a row limit?

There is no hard limit, but very large arrays (over ~100,000 rows) may slow the browser while processing. For larger datasets, use a server-side converter or a command-line tool like <code>jq</code> with a CSV output plugin.

Is my JSON uploaded anywhere?

No. All conversion happens in your browser using JavaScript. Your data &mdash; including any sensitive records &mdash; never leaves your device.

Last updated: July 21, 2026  ·  Author: HT99 Tools Editorial Team  ·  Reviewed by: HT99 Tools Editorial Team