Skip to content

JSON to CSV

Convert a JSON array to CSV.

Input
Output

No result

About JSON to CSV

JSON to CSV takes an array of objects and writes them as a table: the keys of the first object become the header row, and each object becomes one line of data. Fields containing a comma, a quotation mark or a line break are wrapped in quotes automatically, so the result is valid CSV rather than something that only looks like it.

That automatic quoting is what makes the output safe to hand to a spreadsheet. An unescaped comma inside a value would silently shift every subsequent column by one, corrupting the file in a way that is easy to miss until much later — the kind of error that has produced a great many wrong conclusions drawn from a spreadsheet.

The one structural assumption to be aware of is that the header comes from the first object alone. If later objects carry additional keys, those columns will not appear; if they are missing keys the first object had, those cells come out empty.

How to use JSON to CSV

  1. 1 Paste a JSON array of objects.
  2. 2 The CSV representation appears immediately, with the header row taken from the first object.
  3. 3 Copy the output into a spreadsheet or a file with a .csv extension.

Frequently asked questions

What if my objects have different keys?

The columns are decided by the first object. Keys that appear only in later objects will not become columns, and objects missing a key will have that cell left empty. Normalise the shape of your records first if the differences matter.

Will a value containing a comma break the file?

No. Any field containing a comma, a double quote or a line break is automatically wrapped in quotes, and internal quotes are doubled. That is what keeps the column alignment intact when the file is opened in a spreadsheet.

Does it work with a single object rather than an array?

The converter expects an array, since a table needs rows. Wrap your object in square brackets to produce a two-line file with one header row and one data row.

How are nested objects and arrays represented?

They are written into the cell as their JSON text. That keeps the information but makes the cell hard to read in a spreadsheet — flattening the structure first, so each nested value becomes its own column, usually gives a more workable table.

Free, online, and private

Free to use

JSON to CSV is completely free. There is no account to create, no login, and no hidden charge or usage limit.

Runs online in your browser

It is a free online tool that runs entirely in your browser. Nothing to download or install — open the page and start using it right away.

Your data stays private

All processing happens locally on your device. Your input is never uploaded, stored, or tracked, so it never leaves your browser.

How JSON to CSV behaves in detail

These are the specifics of this implementation — the exact ranges, defaults and fixed settings you are working with.

Parameter Value
Header source the keys of the first array element only — nothing else is inspected
Quoting rule a field is wrapped in double quotes only when it contains a quote, a comma or a newline
Escaping an embedded double quote is doubled, so " becomes ""
Empty values null and undefined become empty fields; every other value is written with String()
Row separator a single line feed between rows — CRLF is never emitted

Compiled from the implementation of this tool and checked against it by itoolnet.

What JSON to CSV does not do

Knowing the edges of a tool saves more time than another list of its features. These are the cases where it will not do what you might expect.

  • Columns come from the first object alone. A key that only appears in later records — [{"a":1},{"b":2}] — is missing from the header and its data is discarded, so extra fields in a ragged array disappear silently.
  • Nested values are not flattened or serialised meaningfully: an object cell is written as the literal text [object Object], which is a quiet loss of data rather than a reported error.
  • Anything that is not a non-empty array produces an empty string. A JSON object, a null or an empty array yields no CSV and no explanation, so the output area simply goes blank.
  • There is no quoting mode and no delimiter choice. Fields are quoted only when they have to be, the separator is always a comma, and there is no way to force every field into quotes for a system that requires it.

Tested and documented by itoolnet, the team that builds and maintains this site.

Share & embed this tool

Writing a guide or article? You are welcome to link to JSON to CSV with the snippet below. It is free, runs entirely in your browser, and needs no signup.