Find your next tool

Browse tools or search by task

Explore JSONToonPro

JSON Tools

JSON to CSV Converter Online – Flatten JSON to CSV

Convert JSON arrays to CSV online. Flatten nested objects, create spreadsheet-ready rows and copy or download CSV privately in your browser.

Runs locally in your browser. Nothing you paste is uploaded.

JSON to CSV workspace
Delimiter
3 × 7
Input· JSON
607 chars35 lines
Output· CSV
228 chars4 lines

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

[
{ "id": 1, "name": "Ada Lovelace",
"address": { "city": "London" },
"tags": ["admin", "beta"] },
{ "id": 2, "name": "Grace Hopper",
"address": { "city": "New York" },
"tags": ["admin"] },
{ "id": 3, "name": "Alan Turing, Jr",
"address": { "city": "Wilmslow" },
"tags": [] }
]

CSV output

id,name,address.city,tags
1,Ada Lovelace,London,admin|beta
2,Grace Hopper,New York,admin
3,"Alan Turing, Jr",Wilmslow,

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.

  1. A field containing the delimiter, a double quote, or a line break must be enclosed in double quotes.
  2. A double quote inside a quoted field is escaped by doubling it. The value She said "hi" is written as "She said ""hi""".
  3. 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

DelimiterWhen to use itWatch out for
CommaThe default, expected by most tools and APIsVery common inside free text fields, so quoting kicks in often
SemicolonEuropean locales where the comma is the decimal separatorExcel picks this based on system locale, not on the file
TabTSV files, database bulk loaders, quick shell processingTabs pasted inside a field are invisible and break rows silently
PipeLog style exports and legacy ETL pipelinesNot 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 CSVWhat Excel showsWhy
00745745Leading zeros are stripped because it is read as a number
40123456789012344.01235E+15More than 15 significant digits, converted to scientific notation
1-202-JanInterpreted as a date in the current locale
3/404-MarInterpreted as a date, not a fraction
SEPT11-SepThe famous gene name problem, still active in many builds
+44 20 7946Formula errorA 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

ProblemCauseFix
Rows shift left after a certain lineAn unquoted delimiter inside a fieldEnable proper quoting on export, or switch to tab delimited
Accented characters render as é or similarFile read as Latin-1 rather than UTF-8Save as UTF-8 and add a byte order mark if Excel is the consumer
Columns differ between two exportsSparse records and key order taken from the first object onlyTake the union of keys across all records
One giant unreadable columnNested arrays of objects expanded by indexSplit into a parent file and a child file joined on the id
Trailing empty row on importA final newline at end of fileHarmless, 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.