Convert JSON to CSV

Paste a JSON array of objects and get a CSV table back. The JSON to CSV converter reads every object in the array, takes the union of their keys as the header row, and emits one comma-separated row per object. Fields that contain commas, quotes or newlines are wrapped in double quotes per RFC 4180. The transform runs in your browser; nothing uploads.

Input
Line 1:1 LF cloud_done Saved locally
Result JSON to CSV
0 lines 0 chars

JSON to CSV, plain and predictable

JSON to CSV conversion takes a JSON array of flat objects and produces a CSV table. The header row is the union of every key seen across the array, in the order each key first appears. Every object in the array produces one row. Cells are joined with commas; rows are joined with \n line endings. Strings that contain a comma, a double quote, or a line break are wrapped in double quotes, with internal quotes escaped as "" per RFC 4180.

Numbers, booleans and null in the JSON values are emitted as their plain text form (1, true, empty string for null). Nested objects and nested arrays are not flattened; the converter writes them as their compact JSON literal in the cell, so a value of {"a":1} appears as the string {"a":1} wrapped in double quotes. Missing keys on a given row are emitted as empty cells.

If the input is not a JSON array, the parser message is shown in the output panel. For the inverse direction, see CSV to JSON. If you want a YAML representation of the same array, see JSON to YAML.

How to use convert json to csv

  1. 1Paste a JSON array of objects into the input panel on the left.
  2. 2The CSV table appears in the output panel on the right as you type.
  3. 3Click Copy in the output header to copy the CSV.
  4. 4Click Download to save the result as a .csv file.
  5. 5If the input is not an array of objects, fix the parser message shown in the output panel.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Header row is the union of all keys

The converter walks every object in the array and collects every key it sees. Headers appear in the order each one first appeared in the source. Objects that omit a key emit an empty cell in that column, so a sparse JSON array still produces a rectangular CSV.

RFC 4180 quoting on every cell

A cell containing a comma, a double quote, or a line break is wrapped in double quotes. Internal double quotes escape as "". Cells without those characters are written bare. The result imports cleanly into Excel, Google Sheets, Numbers, and every CSV parser that follows RFC 4180.

Primitives become plain text

Numbers emit in the same digit form the JSON parser returned. Booleans emit as true and false. null emits as an empty cell. Strings emit verbatim, with quoting applied only when the string contains a separator or a quote.

Nested values stay as compact JSON

A value that is itself an object or an array is written as its compact JSON literal in the cell. The cell is then quoted because the literal contains commas and braces. The original JSON is round-trippable through JSON.parse on the cell text.

Runs entirely in your browser

No upload, no server-side processing, no log of what you pasted. The parse and emit run on every keystroke. Arrays of a few thousand objects convert in under a second on a desktop browser.

Worked example

Object keys become the header row, each object becomes one CSV row, fields without commas or quotes stay bare.

Input
[
  { "name": "Alice", "email": "[email protected]", "role": "admin" },
  { "name": "Bob", "email": "[email protected]", "role": "user" }
]
Output
name,email,role
Alice,[email protected],admin
Bob,[email protected],user

Settings reference

Behaviour Effect on output
Input shape JSON array of objects. A bare object or scalar is rejected with the parser message.
Header row Union of every key, in first-seen order.
Field separator Comma.
Line endings \n between rows.
Quoting RFC 4180. Cells containing comma, double quote or newline wrap in "..."; internal quotes escape as "".
null values Emit as an empty cell.
Numbers and booleans Emit as 1, true, false in plain text form.
Nested objects/arrays Emit as compact JSON literal inside the cell, then quoted.
Missing keys Object that omits a header key emits an empty cell in that column.

FAQ

What if my objects have different keys?
The header row is the union of every key seen across the array. Objects that omit a key emit an empty cell in that column. Headers appear in the order each one first appeared in the source, so the most common keys tend to land on the left.
How are nested values written?
A value that is itself an object or an array is written as its compact JSON literal inside the cell, and the cell is quoted because the literal contains commas. The output is round-trippable through JSON.parse on that cell text. If you need a flatter shape, transform the JSON first.
Can I pick a different field separator?
Not from this tool. The output uses commas, which is what RFC 4180, Excel, Google Sheets, and most data warehouses expect. If you need a TSV file, run a find-and-replace afterwards to swap commas for tabs (taking care with quoted fields that already contain commas).
Is the JSON sent anywhere?
No. The parse and emit run entirely in your browser via JavaScript. Nothing is uploaded, nothing is logged, no record of your data exists on our servers.
How are null values written?
A JSON null becomes an empty cell. That keeps the row width correct and matches the convention most spreadsheet tools use for missing values. If you want the literal text null instead, replace nulls in the JSON before pasting.