JSON to CSV

Convert JSON arrays to CSV.

About the JSON to CSV

Turns a JSON array of objects into CSV you can open in Excel or Google Sheets. The header row comes from the keys of the first record, values holding a comma, a quote, or a newline are quoted per RFC 4180, and null is written as an empty cell. Conversion is local, so an API response full of user records never reaches a third-party server on its way to a spreadsheet.

How to use the JSON to CSV

  1. Paste a JSON array of objects into the JSON panel, or press Sample to load an example.
  2. Press Convert to build the CSV.
  3. Check the header row, which is taken from the first record alone.
  4. Press Copy for the clipboard, or Download to save converted.csv.
  5. Import the file as text in Excel when a column holds identifiers rather than quantities.

Frequently asked questions

What does the converted CSV look like?
The sample, two records with id, name, email and active, produces the header id,name,email,active followed by 1,Ada,ada@4devs.app,true and 2,Alan,alan@4devs.app,false. Numbers and booleans are written bare. Only a value that needs quoting gets it, with embedded double quotes doubled, so say "hi" is written as "say ""hi""".
What happens when records have different keys?
The header is taken from the first record only. Converting [{"a":1},{"b":2}] gives a single column a, an empty second row, and b is dropped without a warning. Put a record carrying every key first, or normalise the array before converting.
What happens to nested objects and arrays?
Neither survives. A nested object is written as the literal text [object Object], and a nested array is joined into one quoted cell, so tags of ["a","b"] becomes "a,b". CSV cannot express either shape, so flatten the records to the columns you want before converting.
Why does my JSON fail to convert?
The top level has to be an array. A bare object is rejected with "JSON must be an array of objects to convert to CSV", and an array of plain values such as [1,2,3] fails with "Unable to serialize unrecognized input". An array of arrays does convert, but its first row becomes data rather than a header.
Will the CSV open correctly in Excel?
Yes for ordinary data. Excel applies its own type detection on open, which is what turns long numeric IDs into scientific notation and strips leading zeros from zip codes, so import the file as text when a column holds identifiers.

Related tools