Quick answer
A JSON-to-CSV converter turns a JSON array of objects into spreadsheet rows: each object becomes a row, and the union of every object's keys becomes the column headers. This tool flattens nested objects into dotted columns, joins arrays into a single cell, and quotes any value containing a comma — entirely in your browser, so your data is never uploaded. Paste JSON, click Convert to CSV, then copy or download the result.
How This Tool Converts JSON to CSV
- Accepts a JSON array of objects or a single object; each array element becomes one CSV row.
- Column headers are collected from all unique keys across every object — if objects have different keys, missing cells are left empty.
- Nested objects are flattened automatically using dot notation:
address.cityandaddress.countryeach become their own column. - Array values inside objects (e.g.
"roles": ["admin","editor"]) are joined with|into a single cell value. - Any value containing a comma, double quote, or newline is wrapped in double quotes (and internal quotes are doubled), following the RFC 4180 CSV rules that Excel and Google Sheets expect.
When to Use JSON to CSV
- When you need to open API response data in Excel or Google Sheets for review or sharing.
- When preparing data for bulk import into a database, CRM, or data warehouse that expects CSV format.
- When building a report and your data source is a JSON API response array.
- When handing structured data to a non-technical stakeholder who prefers a spreadsheet view.
Worked example
Here is a realistic array that exposes the three things people most often get wrong — nested objects, arrays inside a record, and objects that don't all share the same keys:
Input JSON
[
{
"id": 1,
"name": "Alice",
"address": { "city": "Boston", "zip": "02101" },
"roles": ["admin", "editor"]
},
{
"id": 2,
"name": "Bob, Jr.",
"address": { "city": "Denver" }
}
]
Output CSV
id,name,address.city,address.zip,roles
1,Alice,Boston,02101,admin | editor
2,"Bob, Jr.",Denver,,
What happened, line by line
- The nested
addressobject was flattened into two columns,address.cityandaddress.zip. - The
rolesarray was collapsed into one cell asadmin | editor— a pipe-joined string, not two columns. - The headers are the union of both objects' keys. The second record has no
address.zipand noroles, so those two trailing cells are left empty (note the two commas at the end of the last row). "Bob, Jr."contains a comma, so it was wrapped in double quotes to keep it in a single column.02101is preserved exactly as written in the CSV — but see the leading-zero gotcha below, because Excel may still mangle it on open.
Edge cases & gotchas
- Excel drops leading zeros. A ZIP code or ID like
02101is correct in the CSV file, but Excel auto-detects it as a number and shows2101. To keep it, import via Data → From Text/CSV and set that column's type to Text rather than double-clicking the file. - Excel and UTF-8. The download is UTF-8, but Excel on Windows assumes the legacy ANSI codepage on a double-click, so accents and emoji show as garbled text. Tick UTF-8 BOM (Excel) before downloading, or import with Data → From Text/CSV and choose UTF-8 as the file origin.
- Arrays of objects become raw JSON. Primitive arrays join cleanly (
admin | editor), but an array of objects is serialized back to JSON strings inside the cell. Flatten or extract those before converting if you need real columns. - Deeply inconsistent objects produce sparse rows. Because headers are the union of every key seen, a set of very different objects yields a wide table with many empty cells — expected, not a bug.
- Order follows first appearance. Columns appear in the order keys are first encountered across the array, so the first object effectively sets the leading column order.
Frequently Asked Questions
What JSON format does this tool accept?
This tool accepts a JSON array of objects or a single JSON object. Each array item becomes one CSV row. Nested objects are flattened automatically using dot notation.
Can I convert nested JSON?
Yes. Nested objects are flattened automatically using dot notation — address.city, address.country, etc. Array values inside objects are joined with | .
Why is my CSV missing fields?
CSV rows are built from object keys. If some objects have different keys, missing values will appear as empty cells.
What delimiter does the CSV output use?
A comma by default, and you can switch to semicolon, tab or pipe, or type a custom character. Quoting follows whichever delimiter you pick, so a value containing that character is automatically wrapped in double quotes. Semicolon output is worth knowing about: Excel in many European locales expects ; as the list separator and will drop a comma-delimited file into a single column.
What happens to null or missing values in JSON?
JSON null values become empty cells in the CSV. If an object is missing a key that other objects in the array have, that cell is also left empty.
Why does Excel show my accented characters or emoji as garbled text?
Tick UTF-8 BOM (Excel) and the problem goes away. The file is written as UTF-8, but Excel on Windows assumes the legacy ANSI codepage when you double-click a .csv, so accents and emoji appear as mojibake. A byte order mark at the start of the file tells Excel it is UTF-8. The BOM is invisible in every other tool, and this converter strips it back off if you send the file through CSV to JSON. Importing via Data → From Text/CSV and choosing UTF-8 also works.
How are arrays of objects handled?
You choose. Join into one cell collapses ["admin","editor"] to admin | editor with a separator you control, and serializes objects to JSON. Indexed columns gives each element its own column — items.0.sku, items.1.sku — which keeps the data queryable. One row per element repeats the parent's scalar fields and emits one row per array item, the shape most databases and pivot tables expect.
Can I choose which columns end up in the CSV?
Yes. After converting, every detected column appears as a checkbox above the output. Untick the ones you do not need — deeply nested keys often produce noisy columns — and the CSV and preview regenerate immediately. This is easier than editing the JSON to remove fields first.
Does it accept NDJSON or JSON Lines input?
Yes. If the input is not a single valid JSON document, each non-empty line is parsed as its own JSON object, which is the NDJSON / JSONL format produced by log pipelines, jq, BigQuery exports and Elasticsearch. No wrapping array is required.