How to Convert JSON to CSV
When you need to open data in a spreadsheet or hand it to a non-developer, CSV beats JSON. Converting works cleanly when your JSON is shaped the right way — here's what that means.
The ideal shape: an array of flat objects
CSV is a table: rows and columns. JSON converts best when it's an array of objects with the same keys:
[
{ "name": "Ada", "role": "engineer" },
{ "name": "Grace", "role": "admiral" }
]
The keys become the header row, and each object becomes a data row:
name,role
Ada,engineer
Grace,admiral
How nesting is handled
CSV has no concept of nested data, so a value that is itself an object or array can't map to a single cell cleanly. Converters typically flatten nested keys (e.g. address.city) or serialize the nested value as text. If your JSON is deeply nested, flatten it to the fields you actually need before converting.
Pitfalls to watch
- Inconsistent keys — if objects have different fields, the header must cover all of them, leaving some cells empty.
- Commas and quotes in values — these get wrapped in double quotes automatically so they don't break columns.
- Order — object key order determines column order; make it consistent.
The other direction
Going the other way? See How to Convert CSV to JSON, and for a broader format comparison, JSON vs XML vs YAML vs CSV.
Try it
Paste a JSON array and get CSV ready for Excel or Google Sheets — all in your browser, nothing uploaded.