JSON to CSV Converter
Convert JSON data to CSV format. Handles nested objects, arrays, and custom delimiters.
📁 Drag & drop JSON file here or click to browse
Convert JSON to CSV for Spreadsheets and Databases
This JSON to CSV converter turns JSON data, such as an API response or a database export, into comma-separated values you can open in Excel or Google Sheets or load into a database. It flattens nested objects into columns, lines up records that have different fields, and escapes values the way spreadsheet software expects. The conversion happens in your browser: pasted text and dropped files are read locally and are not uploaded.
How to Use the JSON to CSV Converter
- Paste JSON into the text box, or drag a .json file onto the drop zone (you can also click the zone to browse for a file).
- The CSV Output box updates on every change. The stats show the number of Rows and Columns and the Output Size.
- Choose a Delimiter: Comma, Semicolon, Tab or Pipe. Leave Include headers on to get a header row of column names, and tick Quote all fields to wrap every value in double quotes.
- Click Copy CSV, or Download CSV to save the result as data.csv (UTF-8 with a byte order mark, so Excel reads accented characters correctly). Clear All resets the tool.
The converter re-runs on every edit, so you can also type JSON by hand. While the JSON is incomplete or has a syntax error, a message under the input box shows the parser's error, and the CSV output stays empty until the JSON parses again. If you need help finding the problem, run the data through the JSON formatter and validator.
Worked Example: Nested JSON to CSV
Here are two customer records with a nested address object, an array of tags, and some awkward text:
[
{
"id": 1,
"name": "Ana",
"address": { "city": "Lisbon", "zip": "1100" },
"tags": ["admin", "beta"]
},
{
"id": 2,
"name": "Ben \"BJ\" Cole",
"address": { "city": "Austin" },
"note": "Line 1\nLine 2, cont."
}
] With the default settings, the CSV output is:
address.city,address.zip,id,name,note,tags
Lisbon,1100,1,Ana,,admin;beta
Austin,,2,"Ben ""BJ"" Cole","Line 1
Line 2, cont.", Here is what happened:
- Nested objects became dot-notation columns.
address.cityandaddress.zipcome from the address object. - Every key from every record became a column. Ben has no zip and Ana has no note, so those cells are empty. A JSON
nullalso becomes an empty cell. - Columns are sorted alphabetically, not kept in the order they appear in the JSON. The sort is by character code, so uppercase names come before lowercase ones and a key named "10" sorts before "2".
- The tags array was joined with semicolons into
admin;beta. If an array holds objects, each object is written as JSON text and the pieces are joined with semicolons, so[{"sku":"A1"},{"sku":"B2"}]ends up in a single cell. - Special characters were escaped. Ben's name contains double quotes, so the field is wrapped in quotes and each inner quote is doubled. The note contains a comma and a line break, so it is quoted too, and the line break stays inside the field.
admin;betaneeds no quotes, because a semicolon is not the delimiter here.
A single JSON object, rather than an array, is converted into one data row. Plain values, such as the numbers in [1, 2, 3], go into a single column named value, one row each; in a mixed array, objects are flattened as usual and plain values fill the value column. An array of arrays, such as [[1, 2], [3, 4]], becomes columns named 0, 1 and so on. A null item in the top-level array has no fields, so it is skipped, and a note under the input box says how many were skipped.
Quoting and Escaping Rules
The converter follows the escaping convention in RFC 4180, the closest thing CSV has to a standard. A field is wrapped in double quotes when it contains the selected delimiter, a double quote or a line break (CR or LF), and any double quote inside it is written twice (""). This applies to every delimiter: with Tab selected, a value containing a tab is quoted, and with Pipe, a value containing a pipe. With Quote all fields on, every value and header is quoted. Some importers expect this.
Rows are separated by a single line feed. RFC 4180 specifies CRLF line endings, but Excel, Google Sheets and common CSV libraries read LF files without trouble.
Cell contents are never trimmed, so a row whose first or last value is empty keeps all its delimiters and its columns stay aligned, including in tab-separated output. In a file with a single column, an empty value is written as "" so the row is not mistaken for a blank line.
Choosing a Delimiter
| Delimiter | Use it when |
|---|---|
| Comma | Default for most tools, databases and APIs |
| Semicolon | Excel in regions that use a comma as decimal mark |
| Tab | Pasting straight into a spreadsheet (TSV) |
| Pipe | Text-heavy data full of commas |
Gotchas to Watch For
- Very large numbers lose precision. JSON numbers are read as JavaScript numbers, so integers above 9,007,199,254,740,991, such as some 64-bit IDs, are rounded (12345678901234567890 becomes 12345678901234567000). Keep IDs like these as strings in your JSON. Number formatting is also normalized, so 1.50 becomes 1.5.
- Keys that already contain dots can collide. A nested
{"user": {"name": ...}}and a literal"user.name"key map to the same column, and only one value is kept. - The download starts with a byte order mark. Download CSV saves UTF-8 with a BOM, which tells Excel to read accented and non-Latin characters correctly when you double-click the file; Copy CSV gives plain text without it. A few programs read the BOM as part of the first column name; in Python, open the file with
encoding="utf-8-sig". If you need a real workbook, use the CSV to Excel converter. - Spreadsheets reformat values. Excel strips leading zeros from codes like 007 and may turn values that look like dates into dates. Import those columns as text.
Frequently Asked Questions
How does the converter handle nested JSON objects?
It flattens them using dot notation. An object like {"address": {"city": "Lisbon"}} becomes a column named address.city with the value Lisbon, and each additional level adds another dot-separated segment.
How are arrays converted?
Arrays inside a record are joined into one cell with semicolons, so ["admin", "beta"] becomes admin;beta. Arrays of objects are written as JSON text joined with semicolons. If you need one row per array item, restructure the JSON so each item is a separate object in the top-level array.
Why are my columns in a different order than in my JSON?
The converter collects every key from every record and sorts the column names alphabetically. Reorder them in your spreadsheet if you need a specific order.
Which delimiter should I use for Excel?
Comma works in most setups. If your Windows or Excel regional settings use a comma as the decimal separator, as in much of Europe, Excel expects semicolons, so choose Semicolon for a file you will open by double-clicking.
Why do some values have double quotes around them?
Values that contain the delimiter, a double quote or a line break are quoted so they are not split into separate columns or rows, and quotes inside a value are doubled. Spreadsheet programs remove this escaping when they open the file.
What if my JSON is invalid?
A message below the input box shows the parser's error, and the CSV output stays empty until the JSON is valid. Nothing pops up, so you can keep typing. The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys and comments, none of which are allowed in JSON.
Can I convert CSV back to JSON?
Yes. Use the CSV to JSON converter, which can turn each row into an object keyed by the header row.
Love using BreezyTools?
Go Pro for an ad-free experience, priority features, and support independent development — for less than a coffee a month.