Skip to main content
ToolsBay

JSON to CSV

Flatten a JSON array of objects into CSV rows.

Runs entirely in your browser — nothing is uploaded

JSON input

1 line

CSV output

1 line

Frequently asked questions

Does it work with a single object, not an array?

Yes. A bare object is treated as a single row. Many converters reject anything that is not an array, which is a common source of confusion when you have one record.

What happens to nested objects?

They are flattened into dotted column names, so {"address":{"city":"London"}} becomes a column called address.city. That keeps every value reachable without changing the number of rows.

What about arrays inside a record?

They are written into the cell as JSON, properly quoted. Splitting them into extra rows would change what each row means, so the tool leaves that decision to you.

Do the objects all need the same keys?

No. The header is the union of every key seen across all records, in the order they first appear. Records missing a key get an empty cell there.

Turning JSON records into a spreadsheet

JSON is a tree; CSV is a grid. Converting between them means deciding what to do with everything that does not fit in a grid, and those decisions are where converters differ.

This one flattens nested objects into dotted columns, keeps arrays whole as JSON inside a cell, and builds the header from the union of all keys so records with different shapes still line up. Values are quoted per RFC 4180 — a field containing a comma, a quote or a line break is wrapped in quotes, and embedded quotes are doubled — so the output opens correctly in Excel, Google Sheets and Numbers.

Choosing a delimiter

Comma is the default and the standard. Semicolon matters in practice because Excel in many European locales, where the comma is the decimal separator, expects it — open a comma-delimited file there and every row lands in one column. Tab-separated output avoids the question entirely and is the safest choice for data full of punctuation.

To inspect or repair the JSON before converting, use the JSON formatter or validator. For XML output instead, use JSON to XML.

All developer tools