JSON to CSV Converter
Convert a JSON array into CSV for Excel, Google Sheets or any spreadsheet. Handles nested objects and missing keys. Runs in your browser.
When you need this
Spreadsheets are still the lingua franca of business data, and CSV is what they read. Converting JSON to CSV lets you take an API response and open it in Excel, Google Sheets, Numbers or LibreOffice Calc.
How the conversion works
The tool collects the union of all keys across every object in the array, in the order they first appear. Rows missing a key get an empty cell, and rows with extra keys get their own columns.
[{"id": 1, "name": "Ada"}, {"id": 2, "name": "Alan", "role": "Engineer"}]
becomes
id,name,role
1,Ada,
2,Alan,Engineer
Nested objects
Nested objects and arrays are serialised to JSON strings inside the cell, so nothing is lost:
id,address
1,"{""city"":""London""}"
If you need proper nesting flattened into separate columns, transform the data first with a tool like jq:
jq '.[] | {id, city: .address.city}' data.json
Quoting rules
The tool follows RFC 4180: a value is wrapped in double quotes if it contains a comma, a double quote, or a line break, and embedded quotes are doubled. This is what makes the output safe to open in Excel without corrupting columns.
Tip for large files
For datasets that would choke a browser tab, jq is much faster:
jq -r '.[] | [.id, .name] | @csv' data.json > output.csv
The @csv operator applies the same RFC 4180 quoting rules.
Frequently asked questions
Is my JSON uploaded to a server?
No. The conversion happens entirely in your browser. The data never leaves your device.
How are nested objects handled?
They are converted to JSON strings inside the cell, so no information is lost. Flatten them first with jq if you need separate columns.
What happens if the objects have different keys?
The tool uses the union of all keys. Missing values become empty cells, and any key only present on some rows gets its own column.
How do I convert CSV back to JSON?
Use the CSV to JSON converter, which parses RFC 4180 CSV including quoted fields, embedded commas and newlines.
Will the output open correctly in Excel?
Yes. The output follows RFC 4180, which is what Excel, Google Sheets and LibreOffice all expect.