Data

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.

Updated 16 September 2026 · 7 min read
Advertisement

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:

  1. Flatten with dot notation — address.city, and arrays joined by a separator.
  2. 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.

Advertisement
Help Center

How to Convert JSON to CSV — FAQ

Take an array of objects, use the object keys as column headers, and each object as a row. Nested objects and arrays must be flattened or serialized first.

Flatten nested keys with dot notation (address.city) or serialize them as JSON strings in a single cell. Choose based on how you will use the data.

Encoding and delimiters. Use UTF-8 with a BOM for Excel, and remember that some locales expect semicolons instead of commas.

Keep reading
Advertisement