JSON to CSV Converter
Turns a JSON array into CSV or TSV. Nested fields become their own columns, every key gets a column even if only some rows have it, and you can convert CSV back to JSON.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
How to Use JSON to CSV Converter
- Paste or open a JSON file. An array of objects works best. If the array sits inside an object, Rows from picks it for you.
- Pick a separator. Comma for most uses, Semicolon for Excel in regions that use a decimal comma, Tab for TSV.
- Adjust the options. Choose how nested objects and arrays are written, and switch on the Excel helpers if the file is for a spreadsheet.
- Check the preview table. It shows the first 50 rows as columns, so you can see that each value landed in the right place.
- Copy or download. Press Copy result, or Download to save a .csv or .tsv file. Switch to CSV to JSON to convert a file back.
Example: an order export with nested fields
The Sample button loads three orders. Each has a nested customer object, a list of items, and some awkward values: a name with a comma, a name with quotes, a note with a line break, a zip code that starts with 0 and a key that only one order has.
{
"orders": [
{
"id": 1001,
"customer": {
"name": "Smith, Anna",
"zip": "02134"
},
"items": [
"pen",
"notebook"
],
"total": 12.5,
"paid": true,
"note": null
},
{
"id": 1002,
"customer": {
"name": "Lee \"JJ\" Park",
"zip": "10001"
},
"items": [
"stapler"
],
"total": 7,
"paid": false,
"note": "Leave at\nfront desk"
},
{
"id": 1003,
"customer": {
"name": "Ola Nordmann"
},
"items": [],
"total": 30.25,
"paid": true,
"coupon": "SPRING10"
}
]
}
The tool finds the array at $.orders by itself and writes:
id,customer.name,customer.zip,items,total,paid,note,coupon
1001,"Smith, Anna",02134,"[""pen"",""notebook""]",12.5,true,,
1002,"Lee ""JJ"" Park",10001,"[""stapler""]",7,false,"Leave at
front desk",
1003,Ola Nordmann,,[],30.25,true,,SPRING10
The status line reads 3 rows × 8 columns · 5 fields quoted. The customer fields became customer.name and customer.zip, the coupon that only order 1003 has still got its own column, and every value that contains a comma, a quote or a line break was wrapped in quotes so a spreadsheet reads it as one cell.
How each option changes a row
The same record, {"id": 7, "user": {"name": "Ann", "city": "Oslo"}, "tags": ["new", "vip"]}, converted with different settings:
| Setting | Header row | Data row |
|---|---|---|
| Default: own columns, arrays as JSON | id,user.name,user.city,tags |
7,Ann,Oslo,"[""new"",""vip""]" |
| Nested objects: JSON text in one cell | id,user,tags |
7,"{""name"":""Ann"",""city"":""Oslo""}","[""new"",""vip""]" |
| Arrays: join values with "; " | id,user.name,user.city,tags |
7,Ann,Oslo,new; vip |
| Arrays: one column per item | id,user.name,user.city,tags.0,tags.1 |
7,Ann,Oslo,new,vip |
| Arrays: first item only | id,user.name,user.city,tags |
7,Ann,Oslo,new |
How tricky values are written
These cells come straight from the tool. The quoting follows RFC 4180, the CSV format that Excel, Google Sheets and most databases read: a field with a comma, a double quote or a line break is wrapped in double quotes, and a double quote inside it is written twice.
| Value with | In JSON | CSV cell (default) | With both Excel options on |
|---|---|---|---|
| a comma | "Smith, John" |
"Smith, John" |
"Smith, John" |
| double quotes | "He said \"hi\"" |
"He said ""hi""" |
"He said ""hi""" |
| a line break | "line 1\nline 2" |
"line 1↵line 2" |
"line 1↵line 2" |
| a leading zero | "02134" |
02134 |
"=""02134""" |
| a formula | "=SUM(A1:A9)" |
=SUM(A1:A9) |
'=SUM(A1:A9) |
| null | null |
empty | empty |
| true | true |
true |
true |
Keep leading zeros writes ="02134", a small formula that Excel shows as the text 02134 instead of the number 2134. Protect against spreadsheet formulas puts an apostrophe in front of any text that starts with =, +, - or @, which is the defence OWASP recommends against CSV injection. Numbers are never changed, so -5 stays -5.
How it works
- Rows come from the array you pick in Rows from. If the JSON is an object, the tool lists every array of objects it can find within four levels and starts with the largest one. A single object becomes one row.
- Columns are the keys in the order they first appear. With Every key found in any row, a key that only some rows have still gets a column and the other rows leave it empty.
- Nested objects become dotted column names. Arrays are written as JSON text by default because that keeps every item; you can also join them, give each item its own column, or keep only the first.
- For TSV, tabs and line breaks inside values are written as
\tand\nso each record stays on one line. Untick that option to use CSV-style quotes instead. - CSV to JSON reads quoted fields, doubled quotes and line breaks inside quotes, detects the separator from the first line, and turns
42,true,falseandnullinto JSON types. Codes with a leading zero such as02134stay text, and dotted names likecustomer.zipbecome nested objects again.
Limits
- Excel opens CSV with the list separator of your region. Where the decimal mark is a comma, as in Germany, France or Greece, it expects semicolons, so choose Semicolon or use Excel’s Data, From Text/CSV import.
- Without the UTF-8 BOM, some versions of Excel show accented letters such as é as two odd characters. Tick Add UTF-8 BOM before you download if the file is for Excel.
- Whole numbers above 9,007,199,254,740,991 in JSON lose precision when read. In CSV to JSON they are kept as text instead.
- The preview shows the first 50 rows. The CSV itself has every row, and files of up to 30 MB can be opened.
Frequently asked questions
How do I open the CSV in Excel without breaking the columns?
Open Quoting, line endings and Excel options, tick Add UTF-8 BOM to the download, then double-click the saved file. If everything lands in column A, your Excel uses semicolons: convert again with Semicolon selected. For codes with leading zeros, tick Keep leading zeros as well.
What happens to nested JSON when it becomes CSV?
Each nested field gets its own column with a dotted name, such as customer.name. If you prefer to keep the whole object together, choose JSON text in one cell. Converting back with CSV to JSON rebuilds the nesting from the dotted names.
What is the difference between CSV and TSV?
Only the separator. CSV uses commas (or semicolons in some regions) and TSV uses a tab. TSV is handy when values often contain commas, such as addresses, and it pastes straight into a spreadsheet as separate columns.
My JSON has an outer object, not an array. Will it work?
Yes. API responses often look like {"data": [ ... ], "page": 1}. The tool finds the data array and uses it for the rows. Pick another array in Rows from, or choose Whole document to get one row.
Related Tools
Convert CSV to JSON →
Converts CSV or TSV to JSON in your browser. It detects the separator, handles…
Convert CSV to Markdown Table →
Convert CSV to GitHub-flavored Markdown table with per-column alignment, HTML preview, delimiter auto-detect. Free,…
Convert CSV to PDF Table →
Convert CSV to formatted PDF tables in your browser. Custom orientation, font size, alternate…
Convert CSV to XML →
Convert CSV to XML with custom tag names, element/attribute modes, CDATA wrap, headerless mode.…
Convert CSV to YAML →
Convert CSV to YAML with smart type detection, multi-line block scalars, reserved-word quoting (no…
CSV Viewer →
View CSV/TSV files as a searchable, sortable table. RFC 4180 parser, XSS-safe rendering, file…
Convert JSON to PDF Report →
Convert JSON data to formatted PDF reports instantly. Free JSON to PDF converter with…
JSON to XML Converter →
Converts JSON to well-formed XML. Keys starting with @ become attributes, arrays become repeated…
JSON to YAML Converter →
Turns JSON into clean, readable YAML. Strings that YAML would misread, such as NO,…
XML to JSON Converter →
Converts XML to JSON with attributes, repeated elements, CDATA and namespaces handled. You choose…
YAML to CSV Converter →
Convert a YAML list of items into CSV, with keys as columns and values…
YAML to JSON Converter →
Converts YAML to JSON with anchors, aliases and