Skip to content
Jellykit

JSON to CSV Converter

Flatten a JSON array into CSV rows that open cleanly in Excel, Numbers or Google Sheets, with a column for every key in any record.

  • Runs on your device
Loading tool

About JSON to CSV Converter

An API answered with a JSON array and you need it in a spreadsheet. Paste the array, or open the .json file, and each object becomes a row. The column list is built from every key that appears anywhere in the array, so records with missing or extra properties still line up under the right headings.

Nested objects and lists are kept as JSON text inside their cell rather than thrown away, and any value containing a comma, a quote or a line break is quoted the way spreadsheet programs expect.

How it works

  1. CSV is parsed according to RFC 4180: fields may be wrapped in double quotes, and a doubled quote inside a field stands for a literal quote.
  2. With a header row, each line becomes an object keyed by the column names, in the order of the columns. Without one, each line becomes an array. Blank lines are skipped; a line of empty fields is kept as a row.
  3. Going the other way, the columns are the union of every key in the JSON array, in the order they first appear. Numbers are copied digit for digit, so long ids are not rounded. Nested objects and arrays are written as JSON text inside the cell.
  4. When writing CSV, text that starts with =, +, - or @ gets a leading apostrophe, so a spreadsheet shows it instead of running it as a formula. Signed numbers such as -5 are left alone, and the result line says how many cells were changed.

Questions

My objects do not all have the same keys. What happens?

Every key seen in any object becomes a column, in the order it first appears. Where an object lacks a key, its cell is left empty, so no data is dropped and no row shifts sideways.

How are nested objects and arrays written?

As JSON text inside a single cell. A spreadsheet shows it as one value, and converting the CSV back gives you the same text to parse again.

How do I get tabs or semicolons instead of commas?

Choose the delimiter above the input. Semicolons suit spreadsheet programs set to a locale that uses the comma as a decimal mark; tabs paste straight into a sheet.

Can it read CSV and give me JSON?

Yes. Change Convert to "CSV to JSON", or press the swap button to feed the result back in. This page opens with JSON to CSV selected.

Everything you enter here is processed in this browser tab. Nothing is uploaded, logged or shared. How privacy works here.