What is JSON to CSV conversion?
JSON to CSV conversion turns an array of JSON objects into a table: each object becomes a row, and its keys become the column names. This converter reads the JSON with a strict parser, flattens nested objects into columns such as user.address.city, keeps arrays as JSON text in one cell, and writes every number exactly as it appears. It runs in your browser, and Download saves a .csv or .tsv file that opens correctly in Excel.
How JSON becomes rows and columns
Each object in the array becomes one row, and a single object on its own becomes a one-row table. The columns are every key that appears in any object, in the order they first appear, so an object that lacks a key gets an empty cell in that column instead of shifting its other values out of line. Every item in the array must be an object: a number or a string has no keys to make columns from, so the converter stops and names the item, with its line and column.
A nested object becomes one column per value, named by its path with dots: {"user":{"address":{"city":"London"}}} gives the column user.address.city. An array can hold any number of values, so giving each value its own column would make the columns depend on the longest array. Instead an array stays JSON text in a single cell, such as ["admin","billing"], which a JSON parser can read back. An empty object is kept as {}.
Strings are written without their JSON quotes and escapes, so "Caf\u00e9" becomes Café. true and false are written as words, and null becomes an empty cell. Numbers are written exactly as they appear in the JSON: 19.90 stays 19.90, and 12345678901234567890 keeps every digit, where a converter built on JavaScript's JSON.parse writes 19.9 and 12345678901234567000.
Duplicate keys and clashing column names
JSON allows an object to repeat a key, and two different keys can flatten to the same column name, such as a key named "a.b" and a key b inside an object a. Most converters keep only one of the two values. This one keeps both, in two columns with the same name, and shows a warning with the line and column where it happened, so no value is lost without notice.
Quoting, line endings, and delimiters
The output follows RFC 4180, the CSV specification. A value is wrapped in double quotes when it contains the delimiter, a double quote, or a line break, and a double quote inside it is written twice, so "Widget, large" stays in one cell. A value that starts or ends with a space is quoted too, because some readers trim unquoted spaces. Each row ends with CRLF (\r\n), as RFC 4180 specifies.
Comma is the standard delimiter. Tab gives tab-separated values, downloaded as a .tsv file. Semicolon is for Excel in regions that use a comma as the decimal separator, where Excel expects semicolons between values. Pipe suits data that is full of commas and semicolons.
Opening the file in Excel or Google Sheets
Download adds a UTF-8 byte order mark (BOM) at the start of the file, as Excel's own CSV UTF-8 format does. Without it, Excel on Windows reads the file in an older system encoding and shows accented letters and emoji as garbled characters, such as José for José. Copy output copies the text without the BOM, for pasting into a spreadsheet, a terminal, or code.
Spreadsheets also convert values as they open a file: Excel drops the leading zeros from 0012, and keeps only 15 significant digits of a long number, so 12345678901234567890 becomes 12345678901234500000. The CSV itself keeps the exact text. To keep it in Excel, import the file with Data > From Text/CSV and set those columns to Text.
Formulas in CSV files (CSV injection)
A spreadsheet treats a cell that starts with =, +, -, or @ as a formula, and OWASP also lists a tab, a line break, and the full-width =, +, -, and @ as risky first characters. If the JSON came from users or another system, a value such as =HYPERLINK(...) can run when someone opens the file. Escape formulas puts an apostrophe before such text and quotes the cell, as OWASP recommends, so the spreadsheet shows it as text. JSON numbers are never changed, so -5 stays a number.
The converter counts these cells whether the setting is on or off. Leave it off when the file is for a program rather than a spreadsheet, because the apostrophe becomes part of the value. OWASP also notes that Excel can lose the protection if the file is saved and reopened in Excel.
How to convert JSON to CSV
- 1Enter JSON. Paste an array of objects, or choose or drop a .json file. The table updates as you type.
- 2Choose the delimiter. Pick Comma for standard CSV, Tab for TSV, or Semicolon for Excel where the comma is the decimal separator. Turn on Escape formulas if the file will be opened in a spreadsheet and you didn't write the data.
- 3Download or copy. Download saves a .csv or .tsv file that opens correctly in Excel, or Copy output copies the text.
Examples
Array of objects to CSV
Input
[{"name":"Ada","role":"Engineer"},{"name":"Alan","role":"Analyst"}]Output
name,role Ada,Engineer Alan,Analyst
Nested objects and arrays
Nested keys become dotted columns; the array stays JSON text in one cell.
Input
[{"id":1,"user":{"name":"Ada","address":{"city":"London"}},"tags":["admin","billing"]}]Output
id,user.name,user.address.city,tags 1,Ada,London,"[""admin"",""billing""]"
Commas, quotes, and line breaks
Each value is quoted, and its quotes are doubled.
Input
[{"item":"Widget, large","note":"Say \"hi\"\nthen leave"}]Output
item,note "Widget, large","Say ""hi"" then leave"
Missing keys and null
Both become empty cells.
Input
[{"a":1,"b":2},{"b":3,"c":null}]Output
a,b,c 1,2, ,3,
Numbers exactly as written
JSON.parse would give 12345678901234567000 and 19.9.
Input
[{"id":12345678901234567890,"price":19.90}]Output
id,price 12345678901234567890,19.90
Tab-separated (TSV)
With Tab, the comma in the value needs no quotes.
Input
[{"city":"Paris, France","population":2102650}]Output
city population Paris, France 2102650
Escape formulas
With Escape formulas on; the number -5 is unchanged.
Input
[{"note":"=1+1","change":-5}]Output
note,change "'=1+1",-5
How JSON values are written
What each part of the JSON becomes in the CSV.
| JSON | In the CSV |
|---|---|
| Array of objects | One row per object |
| Single object | One row |
| Object keys | Column names, in the order they first appear |
| Missing key | Empty cell |
| Nested object {"user":{"name":"Ada"}} | Column user.name |
| Array ["a","b"] | JSON text in one cell: ["a","b"] |
| Empty object {} | {} |
| String "Caf\u00e9" | Café |
| Number 19.90 | 19.90, exactly as written |
| true, false | true, false |
| null | Empty cell |
| Duplicate key | Two columns with the same name |
Frequently asked questions
What JSON shape does the converter expect?
An array of objects, where each object becomes one row, or a single object, which becomes a one-row table. Every item in the array must be an object; if one isn't, the error names the item and its line and column.
How are nested objects and arrays converted?
A nested object becomes one column per value, named by its path with dots, such as user.address.city. An array stays JSON text in a single cell, such as ["admin","billing"], so the table has the same columns however long its arrays are. An empty object is kept as {}.
Are numbers changed?
No. Numbers are written exactly as they appear in the JSON, so 19.90 stays 19.90 and 12345678901234567890 keeps all its digits. Converters that use JavaScript's JSON.parse round them to 19.9 and 12345678901234567000. A spreadsheet may still change them when it opens the file: Excel keeps 15 significant digits.
What happens to duplicate keys?
Both values are kept, in two columns with the same name, and a warning shows where the duplicate is. The same happens when two different keys make the same column name, such as a key named "a.b" and a key b inside an object a.
How are commas, quotes, and line breaks in values handled?
As RFC 4180 specifies: a value that contains the delimiter, a double quote, or a line break is wrapped in double quotes, and each double quote inside it is written twice. Values that start or end with a space are quoted too, and every row ends with CRLF.
Can I open the result in Excel or Google Sheets?
Yes. Download adds a UTF-8 byte order mark, so Excel shows accented letters and emoji correctly, and both open the file directly. If Excel in your region uses a comma as the decimal separator, choose Semicolon. To keep leading zeros or long numbers exactly, import the file with Data > From Text/CSV and set those columns to Text.
What does Escape formulas do?
It puts an apostrophe before text that starts with =, +, -, or @ (or their full-width forms), a tab, or a line break, and quotes the cell, as OWASP recommends against CSV injection, so a spreadsheet shows the text instead of running it as a formula. JSON numbers are never changed. Leave it off for files a program will read, because the apostrophe becomes part of the value.
Is my data uploaded?
No. Conversion runs in your browser, in a background thread, and a file you choose is read on your device. The only exception is the Share link button: when you click it, it uploads the JSON and your settings so the link can reopen the same conversion, so don't share JSON that contains personal data.
Is there a size limit?
Only your browser's memory. Large files are converted in a background thread, so the page stays responsive, and the table shows only the rows in view, so it scrolls smoothly through thousands of rows.
Can I convert CSV back to JSON?
Not with this tool: it converts JSON to CSV and TSV only.