How to Convert JSON to CSV
Paste JSON records, choose the delimiter and header options, then preview the CSV. An array of similarly shaped objects makes the clearest table. Copy or download the output when the columns match your intended spreadsheet.
How Nested JSON Is Flattened
Flattening converts nested paths into column names so fields such as address.city become accessible in a row. Review collisions if a source key already contains the path separator. Turning off flattening keeps complex values serialized in cells.
JSON Arrays, Objects and CSV Headers
Headers come from object keys. Missing properties produce empty cells, so a sparse field remains aligned with its column. Arrays inside a record need a representation such as JSON text because CSV has no native nested-array type.
JSON to CSV Examples
For [{"id":1,"name":"Ada"}], headers are id and name and the next row contains 1 and Ada. Commas, quotes and embedded line breaks inside cells require CSV quoting; do not split CSV naively on commas.
Opening Converted CSV in Excel and Sheets
Import the file with the matching delimiter and UTF-8 encoding. Spreadsheet applications may interpret strings as dates or formulas. Review fields beginning with formula characters before opening untrusted data in a spreadsheet.
More examples and technical details
How Nested JSON Becomes Flat Columns
CSV is a rectangle. Every row has the same number of fields and every field holds a single scalar value. JSON is a tree, so something has to give when you convert one into the other. The standard answer is dot notation: a nested key path is collapsed into one column name by joining the levels with a full stop.
An object like {"id": 7, "address": {"city": "Leeds", "postcode": "LS1 4DY"}} produces three columns: id, address.city, and address.postcode. Nesting can go as deep as you like, and the column name simply grows longer. The rule is reversible, which is what makes a lossless round trip back to JSON possible: split each header on the full stop and rebuild the branches.
Records that do not share the same shape are handled by taking the union of all key paths across the array. A record that lacks a particular path gets an empty cell rather than being skipped, so the rectangle stays intact.
What happens to arrays inside a record
Arrays have two reasonable treatments. The first is joining the elements into one cell with a separator such as a pipe, so ["vip", "beta"] becomes vip|beta. This keeps the column count stable no matter how many elements each record has, and it survives a round trip if you pick a separator that never appears in the data. The second is indexed expansion, where tags[0], tags[1], and tags[2] become their own columns. That preserves element identity but the column count is set by the longest array in the whole file, which produces a lot of empty cells.
Arrays of objects are the hard case. An orders array containing three objects with four keys each turns into twelve columns under indexed expansion. When that happens, it is usually a sign the data wants two CSV files with a shared key rather than one wide file.
Side by Side Example
The same three user records, first as a JSON array and then as the CSV the converter produces with flattening enabled.
JSON input
CSV output
Note row three. The name contains a comma, so the whole field is wrapped in double quotes. The empty array becomes an empty trailing field rather than the text [].
RFC 4180 Quoting Rules
CSV has no single official standard, but RFC 4180 is the closest thing to one and it is what every serious parser expects. Three rules matter.
- A field containing the delimiter, a double quote, or a line break must be enclosed in double quotes.
- A double quote inside a quoted field is escaped by doubling it. The value She said "hi" is written as "She said ""hi""".
- Line endings inside quoted fields are legal. A parser that splits the file on newlines before parsing quotes will corrupt this data, which is why naive split based parsers fail on real exports.
Fields that need no quoting may still be quoted. Quoting everything is valid and slightly larger, and some teams prefer it because the output is uniform.
Choosing a Delimiter
| Delimiter | When to use it | Watch out for |
|---|---|---|
| Comma | The default, expected by most tools and APIs | Very common inside free text fields, so quoting kicks in often |
| Semicolon | European locales where the comma is the decimal separator | Excel picks this based on system locale, not on the file |
| Tab | TSV files, database bulk loaders, quick shell processing | Tabs pasted inside a field are invisible and break rows silently |
| Pipe | Log style exports and legacy ETL pipelines | Not recognised automatically by spreadsheet import dialogs |
If a German or French colleague opens your comma separated file and sees everything crammed into column A, the delimiter is the reason. Their Excel is looking for semicolons. Re-export with a semicolon delimiter rather than asking them to change their regional settings.
Excel Gotchas That Silently Corrupt Data
CSV is plain text with no type information, so Excel guesses. Its guesses are frequently wrong and it does not warn you.
| Value in CSV | What Excel shows | Why |
|---|---|---|
| 00745 | 745 | Leading zeros are stripped because it is read as a number |
| 4012345678901234 | 4.01235E+15 | More than 15 significant digits, converted to scientific notation |
| 1-2 | 02-Jan | Interpreted as a date in the current locale |
| 3/4 | 04-Mar | Interpreted as a date, not a fraction |
| SEPT1 | 1-Sep | The famous gene name problem, still active in many builds |
| +44 20 7946 | Formula error | A leading plus sign starts a formula |
The fix is never to double click the file. Use Data then From Text/CSV, and in the import preview set the type of every identifier column to Text before loading. That instructs Excel to leave the characters alone. If you only need the file read back by a program rather than a human, this problem does not exist at all.
Common Pitfalls and Fixes
| Problem | Cause | Fix |
|---|---|---|
| Rows shift left after a certain line | An unquoted delimiter inside a field | Enable proper quoting on export, or switch to tab delimited |
| Accented characters render as é or similar | File read as Latin-1 rather than UTF-8 | Save as UTF-8 and add a byte order mark if Excel is the consumer |
| Columns differ between two exports | Sparse records and key order taken from the first object only | Take the union of keys across all records |
| One giant unreadable column | Nested arrays of objects expanded by index | Split into a parent file and a child file joined on the id |
| Trailing empty row on import | A final newline at end of file | Harmless, most parsers ignore it, configure skip empty lines |
Working across formats? The same dataset can be pushed further with the full converter collection, including CSV to JSON for the return trip, JSON to Excel when you need real typed cells rather than plain text, and JSON to SQL when the destination is a database table.
Standards and references
Frequently asked questions
How do I convert JSON to CSV?
Paste an array of objects, review flattening and delimiter options, then copy or download the CSV.
Can nested JSON be flattened into CSV?
Yes. Nested object paths can become separate columns; inspect the resulting header names.
How are arrays handled in CSV output?
Primitive arrays use a pipe-separated cell convention; complex values may be serialized. Review a round trip when source strings contain pipes.
Can I download the converted CSV?
Yes. Use the download action after reviewing the preview.
Is my JSON uploaded?
No. Input is processed in this browser tab and is not uploaded by the tool. Copy and download are actions you control; ordinary page analytics do not receive tool input.