JSON to CSV
JSON to CSV Converter
Convert a JSON array — or JSON Lines (NDJSON) — into a valid RFC 4180 CSV. Paste the JSON on the left, copy or download the CSV on the right. Useful for turning an API response into a spreadsheet, or loading structured data into a CSV-only consumer. Runs entirely in the browser: no upload, no account, no size cap beyond available memory.
Before you start
The tool expects one of these three shapes:
- JSON array of objects — the common REST response shape:
[{...}, {...}]. - JSON Lines (JSONL / NDJSON) — one JSON object per line, no outer brackets. This is what you get from
jqwithout the-sflag, and from most streaming log pipelines. - Single object —
{...}. It gets wrapped in a one-element array automatically.
The objects don't need to share the same keys. The header row is the union of every key that appears anywhere in the input, in first-seen order. Missing fields become empty cells.
How to use it
- Paste JSON or drop a
.json/.jsonlfile into the left pane. - Click Convert. The CSV appears on the right and the status bar reports the row count.
- Use Download .csv to save the result, or copy it from the right pane.
If the input parses as JSONL it's auto-detected — you don't need a toggle. The output is always UTF-8 CSV with CRLF line endings (what Excel expects) and standard RFC 4180 quoting (cells with commas, quotes, or newlines get double-quoted).
Example
Input:
[
{ "id": 1, "name": "Alice", "tags": ["ops", "lead"] },
{ "id": 2, "name": "Bob, Jr.", "address": { "city": "Paris" } }
]
Output:
id,name,tags,address
1,Alice,"[""ops"",""lead""]",
2,"Bob, Jr.",,"{""city"":""Paris""}"
Notice three things: "Bob, Jr." is quoted because it contains a comma; nested
objects and arrays are preserved as stringified JSON inside one cell; and the tags /
address columns only appear because one record had them — the other gets an empty cell.
Tips & common pitfalls
- Flatten before you convert. If you want
address.cityas its own column, pre-process the JSON (a one-linejqormapusually does it). This tool intentionally doesn't flatten — doing it wrong silently corrupts data. - Arrays in cells = JSON strings. An object's
tags: ["a","b"]becomes the literal string["a","b"]inside one CSV cell. If you want one-tag-per-row, duplicate the records upstream. - Non-object inputs fail. A top-level JSON array of strings (
["a","b"]) has nothing that maps to columns. Wrap each value in an object first. - Keys are emitted in first-seen order. If your first record is missing a field, that field goes toward the right of the header.
- Excel + UTF-8 headaches. The output is UTF-8 without a BOM. If non-ASCII characters look broken when you open the CSV in Excel, open it via Data → From Text/CSV and pick UTF-8 there instead of double-clicking.
Troubleshooting
I get "Invalid JSON" or a parse error.
Paste the input into any JSON linter to find the offending line. Common causes: trailing commas, single quotes instead of double, stray undefined or Python-style True/None values.
My output has fewer columns than I expected.
The header row is the union of keys present in the objects. If a field exists only as null in every record, it still becomes a column. If a field is genuinely missing from every record, it won't — check the input shape.
The CSV opens in Excel with all data in column A.
That's Excel's regional-settings quirk: in some locales it expects semicolons, not commas. Either open via the Data tab as above, or save the output with a sep=, preamble if you regularly ship CSVs to Excel users.
Frequently asked questions
What if my objects have nested values?
Nested objects and arrays are JSON-stringified into a single cell. This is lossless — re-parse the cell back as JSON to get the original value — but not something Excel will understand. Flatten upstream if you need real columns.
Does this handle JSONL / NDJSON?
Yes. If the input isn't a bracketed JSON array, each non-empty line is parsed as a standalone JSON object. Mixed-shape records are OK; see the header-union behaviour above.
Does the CSV have a BOM?
No. Omitting the BOM is friendlier to every consumer except Excel on Windows. If you specifically need Excel to pick up UTF-8 automatically, either prepend yourself or import via the Data tab.
Is my JSON sent to a server?
No. Parsing and conversion both happen in your browser. See the privacy policy for details on what the site does and doesn't do.