JSON to CSV Converter - Flatten Nested JSON, Pick a Delimiter, Download
Paste a JSON list of objects and get CSV you can open in Excel, Google Sheets or a database import.
Maintained by Hirantha Sandaruwan Lakshan. Updated 15 October 2026.
About this tool
Nested objects become columns such as address.city, lists can be joined, spread into numbered columns or kept as JSON text, and every field is quoted the way RFC 4180 asks. The conversion happens in your browser, so the data never leaves your computer.
How it works
The tool checks your text with the browser's JSON parser and then reads the values itself, so that numbers and keys are kept exactly as you wrote them. If it is a list of objects, each object becomes one row. The columns are the union of the keys of every object, in the order they first appear, and a row that lacks a key gets an empty cell, so objects with different keys still line up. A single object becomes one row. A list of lists is written row by row, with shorter rows padded with empty cells, and a list of plain values gets one column called value. If the document is an object that holds the rows under one key, such as {"data": [...]}, the tool shows a button to use that list. Text with one JSON value on each line (JSON Lines) is read as a list too. Keys stay in the order they have in your document, even keys that are whole numbers such as "2".
Nested objects are flattened by joining the key names with a separator you choose, a dot by default, so {"address": {"city": "Kandy"}} gives a column called address.city. Switch flattening off to keep each nested object as JSON text in one cell. For lists inside a row you can join plain values into one cell (red; green; blue), spread them into numbered columns (tags.0, tags.1) or keep the list as JSON text. A list that holds objects cannot be joined, so it is kept as JSON text. A null becomes an empty cell. If two different keys flatten to the same column name, the later value wins and a warning says so.
Quoting follows RFC 4180. A field that contains the delimiter, a double quote, a carriage return or a line feed is wrapped in double quotes, and each quote inside it is doubled. You can quote every field instead. Rows end with CRLF, as RFC 4180 writes it, or with LF, and the file ends with a line break. The delimiter can be a comma, semicolon, tab or pipe. Excel on a computer whose regional settings use a comma as the decimal mark often expects semicolons, so if everything lands in one column, try the semicolon. Excel on Windows can read a UTF-8 file that has no byte order mark as a legacy encoding and show accented letters wrongly. The byte order mark option adds the three bytes EF BB BF to the downloaded file. The Unicode FAQ describes that mark as a signature that tells a program an unmarked file is UTF-8, and notes that some programs do not expect it, so the option is off by default. The mark is not added to the text you copy.
A spreadsheet can run a cell as a formula, and data from untrusted people can use that. OWASP calls it CSV injection and names cells that start with = + - @, a tab or a carriage return. The optional guard puts an apostrophe in front of any text cell that starts with one of those characters, so the spreadsheet shows it as text. It applies to text only: the JSON number -5 is left alone, but the string "-5" gets the apostrophe. It is off by default because it changes your data. The apostrophe stays visible in programs that do not hide it, and a phone number such as +94 77 123 4567 becomes '+94 77 123 4567. OWASP also warns that these protections are not reliable in Excel once the file has been saved and opened again, so treat the guard as one layer. Turn it on when other people will open the file and the values come from users.
Numbers are copied into the CSV exactly as they are written in your JSON, so 12345678901234567890 keeps every digit, 1.0 stays 1.0 and 1e400 stays 1e400. (The browser's own JSON.parse would turn them into 12345678901234567000, 1 and infinity.) Excel is the limit: Microsoft documents a number precision of 15 digits, so Excel keeps only 15 significant digits of a long ID when it opens the file. The tool counts whole numbers with more than 15 digits and warns you to import those columns as text. Lists of tens of thousands of rows convert in a moment. The result box shows the first 200,000 characters of a long result, and Copy and Download always use the whole result.
Worked examples
Three customers with nested data
Paste a list of three customer objects, each with an id, a name, an address object and a list of tags. The header line is id,name,address.city,address.postcode,tags,note. The first row is 1,Nimal Perera,Colombo,00700,vip; newsletter, and ends with an empty note. The second name, Sanduni "Sandy" Silva, is written "Sanduni ""Sandy"" Silva", and the third, Kamal Fernando, Jr., is quoted because of its comma.
Numbered columns for lists
Choose Numbered columns for the same customers and the header becomes id,name,address.city,address.postcode,tags.0,tags.1,note. The first customer has vip and newsletter in the two new columns. The others leave them empty, and the second customer's empty tags list adds nothing.
Rows inside a wrapper object
An API often returns {"total": 2, "data": [...]}. The tool shows a button, Use the list under "data", or you can type data in the box named Rows are under the key. Each object in the list then becomes a row, and a nested stock object gives the columns stock.colombo and stock.kandy next to sku and price.
Guarding formulas
With the guard on, the text =1+1, +94 77 123 4567, -5 and @home are written as '=1+1, '+94 77 123 4567, '-5 and '@home. The JSON number -5 in a score column stays -5, because a real number is not a formula. Four cells are changed in the example.
When a field is quoted in the CSV (RFC 4180 section 2)
| The value | Quoted? | Written as |
|---|---|---|
| Nimal Perera | No | Nimal Perera |
| Kamal Fernando, Jr. (comma delimiter) | Yes: it contains the delimiter | "Kamal Fernando, Jr." |
| Kamal Fernando; Jr. (semicolon delimiter) | Yes: it contains the delimiter | "Kamal Fernando; Jr." |
| Kamal Fernando; Jr. (comma delimiter) | No: a semicolon is special only when it is the delimiter | Kamal Fernando; Jr. |
| Say "hi" | Yes: it contains a double quote, and the quote is doubled | "Say ""hi""" |
| Line one, a line break, Line two | Yes: it contains a line break | "Line one[line break]Line two" |
| (empty value in the only column) | Written as two quotes, so it is not mistaken for a blank line | "" |
Frequently asked questions
How do I convert nested JSON to CSV?
Leave flattening on. Each nested key becomes a column named by joining the keys with the separator, so address.city holds the city. Lists inside a row can be joined into one cell, spread into numbered columns, or kept as JSON text. Turn flattening off if you would rather keep each nested object as JSON text in one cell.
What happens when the objects have different keys?
The columns are the union of all the keys, in the order they first appear. A row that lacks a key gets an empty cell, so nothing shifts out of place. If you want a different column order, change the order in which the keys first appear in your JSON.
Why does Excel show strange characters or put everything in one column?
Excel on Windows can read a UTF-8 file as a legacy encoding, which garbles accented letters and other alphabets. Turn on the byte order mark option for the download, then open the file again. If everything lands in a single column, the delimiter is not the one Excel expects on your computer, so try the semicolon. Importing the file through Excel's text import lets you choose both.
Why did Excel remove the leading zeros from my values?
The CSV text keeps them: 00700 is written as 00700. Excel turns a cell that looks like a number into a number when it opens the file, and a number has no leading zeros. Import the file through Excel's text import and mark the column as Text, or check the file in a text editor to see that the zeros are there.
What is CSV injection and should I turn the guard on?
A spreadsheet runs a cell that starts with = + - @, a tab or a carriage return as a formula. If your data includes text typed by other people, a crafted value can make the spreadsheet do things the reader did not intend. The guard puts an apostrophe in front of such text. It changes your data and is not a complete defence, so use it when the file is for other people and the values are not yours.
Is my JSON uploaded anywhere?
No. The text is parsed and converted by JavaScript in your browser tab. Nothing is sent to a server, and nothing is stored after you close the page.
How big a file can I convert?
Up to 25 million characters of JSON, which is about 25 MB of plain text. The Open a file button reads files up to 40 MB, and anything above 25 million characters is refused with a message. A list of 50,000 short rows is far below the limit and converts in a moment.
Does a long ID or number keep every digit?
In the CSV, yes. Numbers are copied exactly as they are written in the JSON, so 12345678901234567890 and 0.30000000000000004 come out unchanged. Excel is the limit: it keeps only 15 significant digits of a number (Microsoft's published number precision), so a long ID shows wrongly once Excel opens the file. The tool warns when it sees a whole number with more than 15 digits. In Excel, import that column as Text so it stays as it is.
Does it accept JSON Lines, with one object on each line?
Yes. If the text is not one JSON document but every line is valid JSON on its own, the tool reads it as JSON Lines and says so. Each line becomes a row.
Sources & references
- RFC 4180: Common Format and MIME Type for CSV Files
- RFC 8259: The JSON Data Interchange Format
- OWASP: CSV Injection
- Microsoft Support: Import or export text (.txt or .csv) files
- Microsoft Support: Excel specifications and limits (number precision)
- Unicode FAQ: UTF-8, UTF-16, UTF-32 and BOM
- JSON.parse() - MDN
Updated Oct 15, 2026