How to Convert JSON to CSV
JSON is hierarchical; CSV is flat. Converting between them is mostly about deciding what happens to nested objects and arrays.
JSON vs CSV in one line
JSON is hierarchical and typed. CSV is a flat grid of rows and columns. Converting means deciding how to represent structure in a table.
Convert both ways with the free JSON to CSV tool, and tidy your source with the JSON formatter.
The simple case
An array of flat objects maps cleanly:
[{"id":1,"name":"Ada"},{"id":2,"name":"Alan"}]
becomes:
| id | name |
|---|---|
| 1 | Ada |
| 2 | Alan |
Keys become the header row; each object becomes a row.
The hard case: nested data
[{"id":1,"tags":["a","b"],"address":{"city":"Paris"}}]
Two common strategies:
- Flatten with dot notation —
address.city, and arrays joined by a separator. - Serialize nested values as JSON strings inside a single cell.
Neither is "correct" in the abstract: pick based on whether you need to re-import the data or analyse it in a spreadsheet.
Spreadsheet pitfalls
- Encoding — use UTF-8. Excel may need a BOM to show accents correctly.
- Delimiter — commas vs semicolons vary by locale.
- Quoting — fields containing commas, quotes or newlines must be quoted.
- Leading zeros — phone numbers and IDs can lose them; force text format.
- Large files — spreadsheets choke on millions of rows; use a database.
Converting CSV back to JSON
Use the first row as keys and each subsequent row as an object. Watch for type inference: CSV has no types, so decide whether "42" is a number or a string.
Checklist
- Valid JSON (no trailing commas)
- Flat or deliberately nested
- Correct encoding and delimiter
- Headers present
- Values quoted where needed
Do it in your browser
The JSON to CSV converter runs locally — your data is never uploaded — and handles arrays of objects, flattening and headers.