How JSON to CSV Converter works
This converter turns a JSON array of objects into CSV: each object becomes one row and each distinct key becomes one column. The default input, [{"id":1,"name":"Ada","role":"Engineer"},{"id":2,"name":"Grace","role":"Admiral"}], produces the header id,name,role followed by 1,Ada,Engineer and 2,Grace,Admiral. Columns are collected from every object, not just the first, so records with missing keys get empty cells and stay aligned. Values containing the delimiter, a double quote or a line break are quoted automatically. Nested objects and arrays are not flattened; they are written into a single cell as JSON text.
JSON array to CSV examples
Each result is the exact output of the converter. Line breaks in the CSV are shown as a slash.
Array of flat objects (the default input)
[{"id":1,"name":"Ada","role":"Engineer"},{"id":2,"name":"Grace","role":"Admiral"}]
id,name,role / 1,Ada,Engineer / 2,Grace,Admiral
Summary: Rows 2, Columns 3.
Objects with different keys
[{"id":1,"name":"Ada"},{"id":2,"email":"grace@example.com"},{"name":"Linus","id":3,"phone":"555-0100"}]
id,name,email,phone / 1,Ada,, / 2,,grace@example.com, / 3,Linus,,555-0100
Four columns from three objects. The third object lists name before id, but the column order was already fixed by the first.
Values with a comma, quotes and a line break
[{"name":"Smith, John","quote":"He said \"hi\"","address":"12 High St (line break) Leeds","plain":"ok"}]
name,quote,address,plain / "Smith, John","He said ""hi""","12 High St (line break) Leeds",ok
The quoted address spans two physical lines in the file but is still one record.
Nested array and nested object
[{"id":1,"tags":["a","b"],"address":{"city":"Leeds","zip":"LS1"}}]
id,tags,address / 1,"[""a"",""b""]","{""city"":""Leeds"",""zip"":""LS1""}"
Three columns, not five. The nested values survive intact as JSON text.
Semicolon delimiter
[{"sku":"A-100","price":12.5,"desc":"Red, large"},{"sku":"B-200","price":7.99,"desc":"Blue; small"}] with Delimiter set to Semicolon
sku;price;desc / A-100;12.5;Red, large / B-200;7.99;"Blue; small"
Only the value containing a semicolon is quoted. Numbers keep the dot as the decimal point.
Include header row unticked
The default input
1,Ada,Engineer / 2,Grace,Admiral
How each JSON value type is written to a CSV cell
| JSON value | CSV cell | Notes |
|---|---|---|
| "Ada" | Ada | Strings are written without quotes unless they need them |
| "Smith, John" | "Smith, John" | Quoted because it contains the delimiter |
| 42 | 42 | Numbers are written as plain digits |
| -3.50 | -3.5 | Trailing zeros are not part of a JSON number and are dropped |
| 1e21 | 1e+21 | Very large numbers come out in exponent notation |
| 12345678901234567890 | 12345678901234567000 | Integers above 9007199254740991 lose precision; send long IDs as strings |
| "007" | 007 | A string keeps its leading zeros in the file |
| true / false | true / false | Lowercase words |
| null | (empty) | An empty cell, not the text null |
| key missing from the object | (empty) | Identical to null in the output |
| "" | (empty) | An empty string also gives an empty cell |
| " padded " | padded | Leading and trailing spaces are kept and not quoted |
| ["a","b"] | "[""a"",""b""]" | Arrays become JSON text in one cell |
| {"city":"Leeds"} | "{""city"":""Leeds""}" | Objects become JSON text in one cell |
CSV has no types. The file stores 007 correctly, but a spreadsheet that opens it may still display 7 unless you import that column as text.
Which delimiter to choose
| Delimiter | Output for the default input | Use it when |
|---|---|---|
| Comma | id,name,role / 1,Ada,Engineer | Importing into databases, CRMs, ad platforms and most tools that ask for CSV |
| Semicolon | id;name;role / 1;Ada;Engineer | Opening the file by double-click in Excel where the comma is the decimal separator |
| Tab | id, name, role separated by tab characters | Pasting straight into spreadsheet cells, or when many values contain commas |
| Pipe | id|name|role / 1|Ada|Engineer | Feeding systems that expect pipe-delimited files, or text full of commas and semicolons |
Whichever delimiter you pick, a value containing that character is wrapped in double quotes. With Pipe selected, the value a | b is written as "a | b".
Inputs that are rejected or give a surprising result
| Input | What you get | What to do |
|---|---|---|
| [[1,2],[3,4]] (array of arrays) | Error: Every item in the array must be a plain object. | Turn each inner array into an object with named keys |
| ["a","b"] (array of strings) | The same error | Wrap each value, for example [{"value":"a"},{"value":"b"}] |
| [] (empty array) | Error: The JSON array is empty, so there is nothing to convert. | Paste an array with at least one object |
| {"data":[{"id":1},{"id":2}],"total":2} | One row with the columns data and total; the whole list sits in the data cell as JSON text | Paste only the inner array, the part inside the square brackets |
| [{'id':1}] (single quotes) | Invalid JSON error with the browser's description of the problem | Use double quotes around keys and strings |
| [{"id":1},] (trailing comma) | Invalid JSON error | Remove the comma before the closing bracket |
| [{"last, first":"x","b":1}] (key containing the delimiter) | Header line last, first,b, which reads as three columns over two-column rows | Rename the key or choose a delimiter the key does not contain; header names are not quoted |
Opening the CSV in Excel or Google Sheets
The download is a UTF-8 text file named data.csv with lines separated by a line feed. There is no byte order mark, so Excel may show accented or non-Latin characters as garbled text when the file is opened by double-click. Importing it through Data, From Text/CSV and choosing UTF-8 as the file origin avoids that, and the same dialog lets you mark columns as text.
Marking columns as text matters more often than people expect. A spreadsheet guesses types on open: 007 becomes 7, a long card or order number is shown in exponent form, and a code such as MAR1 can be turned into a date. None of that is in the file; it happens on import.
A cell that starts with an equals sign, such as =SUM(A1:A2), is written exactly as it appears in the JSON and a spreadsheet will treat it as a formula. If the JSON comes from users or another untrusted source, check for such values before opening the export.
What this converter does not do
- Flatten nested objects into dotted columns such as address.city. Nested values stay in one cell as JSON text.
- Expand an array inside a record into several rows.
- Find the list inside a wrapper object. You paste the array itself.
- Read a .json file from disk. Input is pasted text.
- Quote every field or change the quote character. Only values that need quoting are quoted, always with double quotes.
- Reorder, rename or drop columns. Column order follows the order keys first appear.
Using JSON to CSV Converter
- 1
Paste your data into JSON array. It must be valid JSON: double-quoted keys, no trailing commas, no comments.
- 2
Choose a Delimiter: Comma for most imports, Semicolon for Excel in regions that use a decimal comma, Tab for pasting straight into a spreadsheet, or Pipe.
- 3
Leave Include header row ticked to write the key names as the first line, or untick it when appending to a file that already has headers.
- 4
Check Rows and Columns in the Summary against what you expect, then copy the CSV or download it as data.csv.