Skip to content

JSON to CSV Converter

Convert a JSON array of objects (or of arrays) into CSV text that a spreadsheet can open.

JSON to CSV
Paste a JSON array; the CSV appears at once.

Result
CSV
name,age,city
Ana,31,"Paris, FR"
Ben,27,
2
Data rows
3
Columns

Private: Everything runs in this page. Nothing you type is sent anywhere or saved.

On this page
  1. JSON to CSV examples
  2. Formula
  3. How the json to csv works
  4. What this tool does not do
  5. Frequently asked questions
  6. References
  7. Related tools

JSON to CSV examples

JSONCSV (rows separated by a bar)
[{"a":1,"b":2}]a,b | 1,2
[{"n":"Ana"},{"n":"Ben","k":true}]n,k | Ana, | Ben,true
[[1,2],[3,4]]1,2 | 3,4
{"x":"a,b"}x | "a,b"
[{"q":"say \"hi\""}]q | "say ""hi"""

Formula

the header row is every key found; each object becomes one row

How the json to csv works

  1. Step onePaste a JSON array of objects, or an array of arrays.
  2. Step twoChoose the separator that your spreadsheet expects.
  3. Step threeCopy the CSV. The column names are the keys of the objects, in the order they first appear.

What this tool does not do

  • It does not flatten nested objects; they stay as JSON text inside one cell.
  • Line breaks in the CSV are plain line feeds, not the carriage return plus line feed some programs expect.
  • Numbers with more than about 15 to 17 significant digits cannot be kept exactly by a browser; the tool says so when it happens.
  • Duplicate keys keep only the last value; the tool says so when it happens.

Frequently asked questions

What if the objects have different keys?

The header lists every key found in any object, in first-seen order. An object without a key leaves that cell empty.

How are nested values written?

An object or an array inside a value is written as JSON text in one cell. The tool does not flatten nested data.

How are commas and quotes inside values handled?

A value that has the separator, a quote mark or a line break is put in double quotes, and a quote inside it is doubled, as the CSV standard describes.

Can a CSV from untrusted JSON run a formula in a spreadsheet?

A spreadsheet may treat a cell that starts with = + - or @ as a formula. Tick the protection box to put an apostrophe before such text values. Numbers are left alone.

References