Tutorial · JSON → CSV · 3 min read

How to Convert JSON to CSV

Turn a JSON array of objects into a CSV you can open in Excel or Google Sheets, with a header row built from every key and correct quoting.

Spreadsheets are still where data gets reviewed. The reliable way from JSON to a spreadsheet is CSV: one header row of keys, one row per object, values quoted when they contain commas, quotes or newlines.

What you'll learn

  • Convert an array of objects to CSV with a union header
  • Understand how missing keys and nested values are handled
  • Avoid the two mistakes that corrupt a CSV import

Step by step

  1. Paste a JSON array of objects

    Open JSON to CSV. The input must be an array where each item is an object; the tool tells you which item is wrong otherwise.

  2. Click Convert

    The header row is the union of all keys across all objects, in first-seen order. Missing keys produce empty cells.

    [{"id":1,"name":"Ada"},{"id":2,"name":"Grace","team":"infra"}]
    
    →
    
    id,name,team
    1,Ada,
    2,Grace,infra
  3. Check quoting

    A value containing a comma, a double quote or a newline is wrapped in double quotes, with inner quotes doubled, exactly as spreadsheets expect.

  4. Copy and import

    Copy Output, paste into a .csv file, and open it. Nested objects and arrays are serialised as JSON strings inside their cell.

Open the tool with this example Runs in your browser. Nothing you paste is uploaded.

Common problems

Every item must be an object

Arrays of numbers or strings have no keys to build a header from. Wrap each value in an object, for example [{"value": 5}].

Columns shifted in the spreadsheet

A value contained a comma and was not quoted by the source. This converter quotes automatically; if you edited the CSV by hand afterwards, check that row.

FAQ

Does it flatten nested objects?

No. Nested values are kept as JSON text in a single cell so no data is lost. Flatten first if you need one column per nested key.