How do I convert JSON to CSV?
Paste your JSON into the input box, or press Open file and pick a .json file. The CSV is produced as you type, with a table preview of the first 10 rows. Press Copy CSV, or Download .csv to save a file.
CSV is flat and JSON is a tree, so each object in an array becomes one row and every key becomes a column.
- Paste JSON or open a file. The example is already loaded so you can see the result before you start.
- Check the status line under the options. It says which array supplied the rows, or the exact line and column of a syntax error.
- Pick a delimiter. Use a comma by default, a semicolon if your spreadsheet is set to a European locale, or a tab for TSV.
- Tick Excel friendly if the file will be opened in Excel and contains anything beyond plain English letters.
- Copy or download. The copy never includes the byte order mark, only the downloaded file does, so pasted text stays clean.
How are nested objects and arrays flattened?
Nested objects become dot paths. A record like {"user":{"name":"Asha","address":{"city":"Pune"}}} turns into the columns user.name and user.address.city.
Arrays are different, because an array of three tags is not three columns that every other row also has. Instead of guessing, the tool keeps an array in a single cell and gives you two choices:
- Join with "; " writes
admin; beta. It reads well and is easy to split again, but an item that contains a semicolon becomes ambiguous. - JSON string writes
["admin","beta"]. It is lossless and unambiguous, but the quotes get doubled in the CSV, so it looks busier.
Objects inside an array are always written as JSON text, because there is no single sensible way to spread them across columns. An empty object becomes an empty cell and null becomes an empty cell too. A limit worth knowing: if one record has a literal key called a.b and another has {"a":{"b":1}}, both land in the same column, since the dot path is the only name the CSV header has.
What if my JSON is an object, not an array?
Many APIs wrap their list, for example {"status":"ok","data":[...]}. When the top level is an object, the tool looks for the first property whose value is an array of objects, uses it for the rows, and names it in the status line. If there is none, the object itself becomes a single row, so a record with a tags list stays one row. If your JSON has several record arrays and the first one is not the one you want, copy the one you need and paste it on its own.
What are the CSV rules for commas, quotes and line breaks?
The closest thing to a specification is RFC 4180, published in October 2005. It is an informational document that records what most programs do, not a binding standard, but nearly every parser follows it. We checked the text in December 2026. The rules this tool applies:
- Each record is on its own line, separated by CRLF, and the last record may or may not end with a line break (section 2, items 1 and 2).
- An optional header line comes first and uses the same format as the other lines (item 3).
- A field that contains a line break, a double quote or a comma must be wrapped in double quotes (item 6).
- A double quote inside a quoted field is escaped by writing it twice (item 7).
- Spaces are part of the field and are not trimmed (item 4).
When you choose a semicolon or a tab, the same quoting rule applies to that character instead of the comma. RFC 4180 only defines the comma, so semicolon and tab files are common practice rather than part of the document.
Worked example
This record contains a comma, quotes, a nested object and an array:
{"id": 7, "name": "Dana", "note": "Said \"hi\", left", "geo": {"lat": 15.36}, "tags": ["a", "b"]}The CSV output, with the default options, is:
id,name,note,geo.lat,tags
7,Dana,"Said ""hi"", left",15.36,a; bThe note field is wrapped in quotes because it holds a comma and a quote, and each inner quote is doubled. The nested geo.lat became its own column. The array became a; b.
Why does Excel show broken characters, one column, or changed numbers?
The CSV is fine in these cases. Excel is guessing, and it guesses differently from the rules above. Three quirks cause most complaints:
| Symptom | Cause | Fix |
|---|---|---|
| é shows as é, emoji as question marks | Excel opens a double-clicked CSV in your system code page unless the file starts with a UTF-8 byte order mark (BOM). | Tick Excel friendly. It adds the three-byte BOM to the downloaded file. |
| Everything is in column A | Excel uses the list separator from your regional settings. Where the comma is the decimal mark, that is usually a semicolon. | Choose Semicolon, or import with Data, From Text/CSV and set the delimiter. |
| Zip code 00501 becomes 501, long IDs end in zeros | Excel converts anything that looks like a number. It keeps 15 significant digits and drops leading zeros. | Import the column as Text with Data, From Text/CSV. A CSV has no way to mark a column as text. |
| Text such as 1-2 turns into a date | Excel reads some strings as dates when opening the file. | Import that column as Text. |
| Imported cell runs a formula | A text value that starts with =, +, - or @ can be run as a formula by spreadsheet apps, a known risk called CSV injection (OWASP). | Tick Neutralize formulas to prefix those values (and any starting with a tab or carriage return) with an apostrophe. Plain numbers such as -5 are left alone. It is off by default because it changes your data. |
The BOM is only useful for Excel. Many other programs, including some importers and command line tools, treat it as part of the first column name, so leave it off when the CSV is going to a database or a script.
Edge cases and limits
- Large numbers. JavaScript reads JSON numbers as 64-bit floating point. An integer above 9,007,199,254,740,991 (253 minus 1) can lose its last digits before conversion. If you have big IDs, store them as strings in the JSON.
- Mixed rows. Items in the array that are not objects, such as plain numbers or strings, go into a column called
value. - Column order. Columns follow the first time each key appears, not alphabetical order, so the first record sets the order.
- Size. The preview shows only the first 10 rows, but the CSV output has all of them. For very large files, use Download instead of the output box.
- Invalid JSON. JSON allows only double quotes, no trailing commas and no comments. The tool names the line and column where the parser stopped, which is usually at or just after the real mistake.
Can it convert CSV back to JSON?
Yes, switch the direction at the top. The first row is used as the keys, every value stays a string, and quoted fields with commas, doubled quotes and line breaks are read back correctly. It does not turn dot paths back into nested objects, and it does not guess that "5" should be a number, because a wrong guess silently changes data.
Frequently asked questions
How do I convert JSON to CSV?
Paste your JSON into the box above or load a .json file, and the CSV appears instantly. Then press Copy CSV or Download .csv. Everything runs in your browser, so the data is never uploaded.
How do you convert nested JSON to CSV?
Nested objects are flattened into columns named with dot paths, so {"user":{"address":{"city":"Pune"}}} becomes a column called user.address.city. Arrays inside a record stay in one cell, either joined with "; " or written as a JSON string, your choice.
Why does my CSV show strange characters in Excel?
Excel often assumes a CSV is in your system code page unless the file starts with a UTF-8 byte order mark. Tick "Excel friendly (UTF-8 BOM)" before downloading and accented letters, CJK text and emoji should display correctly.
Why is everything in one column in Excel?
Excel splits CSV files using the list separator from your regional settings. In many European locales that is a semicolon, not a comma. Switch the delimiter to semicolon here, or import with Data, From Text/CSV and choose the delimiter.
Can the input be an object instead of an array?
Yes. A single object becomes one row. If the top-level object wraps a list, such as {"data":[...]}, the first array of records is used and the tool tells you which one it picked.
How are commas, quotes and line breaks handled?
A field that contains the delimiter, a double quote or a line break is wrapped in double quotes, and any double quote inside it is doubled. This is the rule in RFC 4180, section 2, items 6 and 7.
What happens when records have different keys?
The columns are the union of every key in the order each one first appears. A record that lacks a key gets an empty cell in that column.
Is my JSON uploaded to a server?
No. Parsing, conversion and file reading all happen in your browser with JavaScript. Nothing you paste or open leaves your device.