JT
JSON to CSV Converter
Convert a JSON array of objects into a downloadable CSV file, with a header row built from every key and proper comma/quote handling.
More Developer Tools Tools
How to Use JSON to CSV Converter
Paste a JSON array of objects — flat, or with shallow nested objects — and get back a CSV table with a header row and one row per object. Commas, quotes, and line breaks inside values are quoted correctly so the file opens cleanly in Excel, Google Sheets, or any spreadsheet tool. Click Download to save it as a .csv file, or copy the text directly.
About JSON to CSV Converter
CSV (comma-separated values) remains the most universally supported tabular data format: every spreadsheet application, database import tool, and data pipeline can read it, whereas JSON — despite being the web's default data interchange format — is not something most non-technical tools open directly. Converting a JSON array of objects into CSV is one of the most frequent "glue" tasks in day-to-day development and data work: exporting an API response for a colleague to open in Excel, turning a database query result into a report, or preparing data for a bulk-import tool that only accepts CSV.
The conversion works on a JSON array where each element is an object — for example, a list of user records or product rows. The header row is built from the union of every key that appears across all objects in the array, not just the keys in the first object, so if some records have an extra field that others lack, that field still gets its own column and simply appears blank for rows that don't have it. Objects nested one level deep are flattened using dot notation — a field like `address: { city: "London", postcode: "E1 6AN" }` becomes two separate columns, `address.city` and `address.postcode` — which keeps the output genuinely tabular rather than dumping a stringified object into a single cell. Arrays found as a value (rather than as the top-level input) are serialised to a compact JSON string within their cell, since a CSV cell cannot itself hold a nested list.
Quoting follows the standard CSV convention (as used by RFC 4180 and virtually every CSV parser in practice): any field containing a comma, a double quote, or a line break is wrapped in double quotes, and any double quote inside that field is doubled (`"` becomes `""`) so it round-trips correctly when read back. Fields that don't need quoting are left bare, keeping the output readable. Getting this right matters — a naive CSV export that just joins values with commas will silently corrupt any value that happens to contain a comma (an address, a product description, a note field), producing a file with the wrong number of columns on some rows and no error to warn you.
If the pasted input isn't valid JSON, isn't an array, or is an array that doesn't contain objects (for example, an array of plain numbers or strings), the tool shows a clear inline error explaining what it expected instead of silently producing an empty or nonsensical CSV.
Details & Tips
How flattening works: only plain nested objects are flattened, one level, using `parentKey.childKey` as the resulting column name. If a nested object itself contains another nested object, that inner object is also flattened using the full dot path (e.g. `address.geo.lat`), so nesting of any depth is supported — "shallow" here refers to the common case, not a hard limit. Arrays are not flattened into separate columns (since their length can vary row to row); instead the array is serialised as a compact JSON string in a single cell, which keeps every row structurally consistent.
Worked example — input:
`[{"name":"Alice","age":30,"tags":["admin","eu"]},{"name":"Bo, Jr.","age":25}]`
Output CSV:
```
name,age,tags
Alice,30,"[""admin"",""eu""]"
"Bo, Jr.",25,
```
Note how `Bo, Jr.` is quoted because it contains a comma, the `tags` array becomes a quoted JSON string with its internal quotes doubled, and the second row's missing `tags` field is simply left blank — the header row still has three columns because the union of keys across both objects includes `tags`.
Error handling: pasting something that isn't valid JSON shows a JSON parse error with the position of the problem. Pasting a JSON object instead of an array, or an array of primitives instead of objects, shows a message explaining the tool needs "an array of objects" specifically, since a header row and per-row cells only make sense for that shape. Empty arrays convert to an empty CSV with no header, since there is nothing to derive column names from.
The Download button builds the CSV as a Blob (with a UTF-8 byte-order mark prefixed, which improves compatibility with Excel on Windows when the data contains non-ASCII characters) and triggers a save via a temporary `<a download>` link — no server round-trip, no upload. The Copy button copies the same text to your clipboard for pasting directly into a spreadsheet.
Frequently Asked Questions
What JSON structure does this tool expect?
A JSON array where each element is an object, e.g. [{"name":"Alice","age":30}]. Other shapes — a single object, or an array of plain values — show a clear error since there is no header row or per-row cell mapping to build from them.
What happens if some objects have different fields than others?
The header row is built from the union of every key across all objects in the array. Rows that lack a particular field simply get a blank cell in that column, so no data is lost or misaligned.
How are nested objects handled?
They are flattened using dot notation — for example, address.city becomes a column name. Nesting of any depth is supported, not just one level.
How are arrays inside an object handled?
An array value is serialised as a compact JSON string within its cell (with internal quotes doubled per CSV rules), since a single CSV cell cannot represent a variable-length nested list.
What happens to commas or quotes inside a value?
Any field containing a comma, double quote, or line break is automatically wrapped in double quotes, with internal quotes doubled, following standard CSV quoting rules — so the file stays correctly structured when reopened.
Will the CSV open correctly in Excel?
Yes. The downloaded file includes a UTF-8 byte-order mark, which helps Excel on Windows correctly detect the encoding and display non-ASCII characters (accented letters, currency symbols, etc.) properly.
Is there a limit on how much data I can convert?
There is no hard-coded limit, but very large inputs (tens of thousands of rows) are processed entirely in your browser's memory, so performance depends on your device — for very large datasets a dedicated command-line tool may be faster.
Is my data uploaded to a server?
No. The conversion runs entirely in JavaScript in your browser; nothing you paste is sent anywhere.
Can I reorder the columns in the output?
Column order follows the order keys first appear across the objects in your array. To force a specific order, reorder the keys in your source JSON before pasting it in.
What if my array is empty?
An empty array produces an empty CSV with no header row, since there are no keys to derive column names from.
Does it support delimiters other than commas, like semicolons?
No, the output uses standard comma-separated values only, which is the most broadly compatible format across spreadsheet and database tools.
Part of These Collections
Also Available As
json to csv, json to csv converter, convert json to csv, json array to csv, export json as csv
Found a Problem?
Let us know if something with JSON to CSV Converter isn't working as expected.
Something went wrong. Please try again.
Thanks — we'll take a look.