JSON to CSV

Turn JSON arrays into spreadsheet-ready CSV.

Runs in your browser Instant No sign-up
Delimiter
JSON array
CSV
Reverse

Paste, type or drop a file — output appears as you type.

Waiting for input
Processed locally · nothing is uploadedProcessed locally

How to use the JSON to CSV converter

  1. Paste or drop a JSON array into the left pane. Invalid JSON is reported with the exact line and column.
  2. Delimiter: comma, semicolon, tab or pipe.
  3. Flatten nested: expands nested objects into parent.child columns.
  4. Header row: writes the column names as the first line. Turn it off when appending rows to an existing file.
  5. Excel UTF-8 BOM: adds a byte order mark at the start of the file so Excel recognizes it as UTF-8 when you double-click it.
  6. Copy or Download as data.csv. The status bar shows the row and column count.

Example

[
  { "id": 1, "name": "Ada", "address": { "city": "London" }, "tags": ["admin"] },
  { "id": 2, "name": "Linh, Nguyen", "address": { "city": "Hanoi" } },
  { "id": 3, "name": "Grace \"Amazing\" Hopper", "active": false }
]

becomes

id,name,address.city,tags,active
1,Ada,London,"[""admin""]",
2,"Linh, Nguyen",Hanoi,,
3,"Grace ""Amazing"" Hopper",,,false

When to use it

Use it to hand API data to someone who works in spreadsheets, to load records into a tool that imports CSV (CRMs, BI dashboards, a database COPY command), or simply to scan a long array as a table. If your data starts out as XML, convert it with XML to JSON first.

Quoting rules (RFC 4180)

A cell is wrapped in double quotes only when it has to be:

  • it contains the delimiter (Linh, Nguyen),
  • it contains a double quote, which is doubled (" becomes ""),
  • it contains a line break,
  • it starts or ends with a space, so spreadsheets don’t trim it.

Everything else is written as-is. Numbers and booleans appear exactly as in the JSON (1250.5, false), and big integers keep all their digits.

Tips for spreadsheets

  • Leading zeros: Excel drops the zeros from values like 007 when it opens a CSV, even though the file is correct. To keep them, import with Data → From Text/CSV and set the column type to Text.
  • Accented characters: the file is UTF-8. If accents look garbled after double-clicking the file in Excel, turn on Excel UTF-8 BOM and download again, or import it through Data → From Text/CSV and choose UTF-8 as the file origin.
  • Round trip: the Reverse button above the output sends the CSV to CSV to JSON, which reads it back, including quoted and multi-line fields.

Converting in code

# jq: array of flat objects → CSV
jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]]) | @csv' data.json
# pandas — json_normalize flattens nested objects into dot-separated columns
import json
import pandas as pd

with open("data.json") as f:
    pd.json_normalize(json.load(f)).to_csv("data.csv", index=False)

The jq version takes its columns from the first object only, so keys that appear only in later rows are lost. This tool merges keys across all rows.

Working with line-delimited data? Convert it with JSONL to JSON first, or tidy the input with the JSON Formatter.

Frequently asked questions

What JSON shapes can be converted?

An array of objects gives one row per object, and the columns are the union of all keys in order of first appearance. An array of arrays is written row by row with no header. A single object becomes one row. An array of plain values becomes a single column named "value".

How are nested objects and arrays handled?

With "Flatten nested" on, nested objects become dot-separated columns such as address.city. Arrays, and objects when flattening is off, are written into the cell as compact JSON, for example ["admin"].

What if rows have different keys?

Every key that appears in any row gets a column. Rows without that key get an empty cell, and so do null values.

Which delimiter should I pick for Excel?

Comma works in most locales. Where the comma is the decimal separator (much of Europe, and Vietnam), Excel expects semicolons, so choose Semicolon if the file opens as a single column. Tab is the safest choice for pasting straight into a spreadsheet.

Is my data uploaded?

No. The conversion runs entirely in your browser, and nothing is uploaded.

Last updated