JSON to CSV
Convert JSON files and JSON data into CSV format instantly with this free client-side converter. Secure, fast, and works directly in your browser.
Loading tool…
Turning nested JSON into a flat table
JSON is a tree: objects can contain objects, which can contain arrays of more objects, to any depth. CSV is a grid: rows and columns, nothing nested. Converting between them means flattening, and flattening always involves choices about how a tree becomes a table.
The usual approach is to treat each element of the top-level array as a row, and each leaf value as a column, joining nested keys into dotted paths so user.address.city becomes a single column name. Arrays inside a record either become indexed columns or a joined string. Fields missing from some records leave empty cells. Understanding this is what stops the output surprising you: a deeply nested payload can produce far more columns than you expected, and irregular records produce a sparse grid.
Why we built this tool
The reason is almost always the same: someone needs the data in a spreadsheet. An API returns JSON, but the finance team works in Excel, the analyst wants a pivot table, or a system will only import CSV.
That exported data is typically customer records, orders, or usage logs — precisely the material that should not be pasted into an unknown converter. We built this to run in the browser so the conversion is a local computation: your JSON is parsed, flattened, and re-serialised as CSV on your own machine, then downloaded. No upload, no row limit, no account. For anyone handling personal data under the GDPR, that difference is not a preference; it is the difference between a local operation and a transfer to a third party.
Tips and common mistakes
- Deeply nested payloads produce very wide tables; flatten only the branch you need rather than the whole document.
- Use a semicolon delimiter if the spreadsheet will be opened in a locale where the comma is the decimal separator.
- Fields absent from some records leave blank cells, which is correct behaviour rather than data loss.
- Long numeric identifiers can be mangled by spreadsheets into scientific notation — import them as text.
Open JSON to CSV with a link
Assistants and scripts can open JSON to CSV with its input already in the link, after the #, which never leaves your device:
#text=— the text to work on#json=— the JSON document
Example: https://mygadgets.ink/tools/json-to-csv/#text=...&json=... · also compressed gz fields and ?url=. How tool links work
Quick start: using JSON to CSV
- Paste or load the JSON you want to convert — usually an array of objects.
- Check the detected columns and adjust the delimiter if your spreadsheet expects semicolons.
- Run the conversion and review the first few rows in the preview.
- Confirm that nested fields flattened the way you expected.
- Download the CSV and open it in your spreadsheet application.
The reverse trip is CSV to JSON. If the source will not parse, check it with JSON Validator first.
How the conversion maps
An array of JSON objects becomes a CSV table. Each object turns into a row; the object keys become the column headers. A list of records with name, email, and age fields produces a CSV with those three columns and one row per record — exactly what a spreadsheet expects.
The nested-data challenge
CSV is flat — a simple grid of cells. JSON is not; it happily nests objects and arrays inside each other. That mismatch is the main thing to plan for:
- Nested objects must be flattened. A
addressobject withcityandziptypically becomes columns likeaddress.cityandaddress.zip. - Arrays inside a record — a list of tags, say — have no natural single-cell representation. They are often joined into one cell or spread across numbered columns.
- Inconsistent keys. If some records have fields others lack, the CSV needs a column for every key that appears, with blanks where a record does not have it.
The cleaner and flatter your JSON, the cleaner the CSV. Deeply nested data may need reshaping first.
Prepare the JSON first
If your JSON is messy or you are unsure it is valid, run it through JSON Validator and JSON Formatter before converting — a malformed array will not convert cleanly. Format first, confirm the structure is a flat array of objects, then convert.
Common uses
- Hand data to non-technical colleagues in a spreadsheet.
- Import into Excel or Google Sheets for analysis.
- Create a report from an API response.
- Load data into tools that only accept CSV.