This JSON to CSV converter turns JSON data, such as an export from an API, a database or a web app, into a CSV file you can open in Excel, Google Sheets, Numbers or LibreOffice. It finds every field across all your records, flattens nested objects into their own columns, and quotes values correctly so that commas and line breaks inside your data don't break the spreadsheet.
How to convert JSON to CSV
- Paste your JSON into the input box, or click Load Sample to see an example.
- Choose a delimiter. Use comma for most spreadsheets, and semicolon if Excel in your region expects it (see below).
- Leave Flatten nested objects on to turn fields like
{"address": {"city": "Pune"}}into anaddress.citycolumn. - Check the preview, then copy the CSV or click the download button to save a
.csvfile.
What JSON can be converted
The converter accepts:
- An array of objects, the most common shape:
[{"name": "Ann", "age": 31}, {"name": "Ben", "age": 28}]. Each object becomes one row. - A single object, which becomes one row.
- An array of plain values, such as
[3, 5, 8], which becomes a single column calledvalue.
How fields become columns
Real-world JSON is rarely uniform: some records have extra fields, others leave fields out. The converter collects every field name from every record, in the order it first sees them, and leaves a cell empty where a record doesn't have that field. No field is dropped because it's missing from the first record.
For example, this input:
[
{"id": 1, "name": "Ann", "address": {"city": "Pune"}},
{"id": 2, "name": "Ben", "email": "[email protected]"}
]
becomes:
id,name,address.city,email
1,Ann,Pune,
2,Ben,,[email protected]
Nested objects and arrays
With Flatten nested objects on, objects inside objects become dot-separated columns at any depth, such as user.address.city. Arrays can hold any number of items, so they aren't spread across columns. Each array is kept in a single cell as JSON text, for example ["red","blue"], which you can split later if you need to.
With flattening off, each nested object is kept in a single cell as JSON text instead.
How values are written
The output follows the standard CSV rules (RFC 4180) that spreadsheets expect:
- A value containing the delimiter, a double quote or a line break is wrapped in double quotes.
- Double quotes inside a value are doubled, so
say "hi"becomes"say ""hi""". - Values with spaces at the start or end are quoted, so the spaces aren't lost.
nulland missing fields become empty cells;trueandfalsestay as text.
Opening the CSV in Excel
- Accented letters and other scripts. The downloaded file starts with a small marker (a UTF-8 byte-order mark) that tells Excel how to read characters such as é, ü or 中文. Without it, Excel often shows them as garbled symbols.
- Columns all in one. In many European countries Excel expects semicolons, because the comma is the decimal separator. If everything lands in column A, convert again with the semicolon delimiter.
- Lost leading zeros. Excel turns values like
00123or phone numbers into numbers and removes the zeros. To keep them, import the file with Data → From Text/CSV and set those columns to Text. - Values that start with
=,+,-or@. Spreadsheet apps may treat them as formulas. Be careful when opening CSV files built from data you don't trust.
JSON to CSV FAQ
Is my JSON uploaded anywhere?
No. The conversion runs entirely in your browser, so it's safe for private or customer data.
Why are some cells empty?
That record doesn't have the field for that column. Empty cells keep every row lined up with the column headings.
Can I convert very large JSON files?
Yes, within the limits of your browser's memory. Files of several megabytes convert quickly on a computer.
How do I convert the CSV back to JSON?
Use the CSV to JSON converter. To check your JSON is valid before converting, use the JSON formatter and validator.
What's the difference between CSV and JSON?
CSV is a flat table: rows and columns, which is what spreadsheets need. JSON can hold nested structures and lists. Converting to CSV flattens that structure into columns, which is why nested objects and arrays need the special handling described above.