JSON ↔ CSV Converter
Paste a JSON array or a CSV and get the other format instantly. Handles nested objects by flattening dot-notation keys. Direction is auto-detected, or you can switch manually. Nothing uploaded.
Learn more: how JSON is flattened into CSV
Nested objects become dotted column names
CSV has no nesting, so every cell holds one flat value. The converter turns {"address": {"city": "Boston"}} into a column called address.city. It joins keys with a period and recurses up to the flatten depth you pick, which defaults to 2.
Anything nested deeper than that limit is written into its cell as JSON text. With depth 2, {"a":{"b":{"c":{"d":1}}}} gives a column a.b.c holding {"d":1}. Arrays are also written as JSON text in one cell, for example [1,2], because CSV has no standard way to spread a list over rows or columns.
Columns come from every record, in the order they first appear. A record that lacks a field leaves that cell empty.
What the CSV rules say
RFC 4180, published in October 2005, says it is an informational memo and "does not specify an Internet standard of any kind". It notes that no MIME type had been registered for CSV before. It also says fields containing line breaks, double quotes or commas should be enclosed in double quotes, and that a double quote inside a field is escaped by doubling it.
The converter follows those quoting rules in both directions. When reading CSV, quoted fields can contain commas, doubled quotes and line breaks, and both LF and CRLF line endings work.
Converting CSV back to JSON
The CSV-to-JSON direction turns each row into an object keyed by the header. Empty cells and the text null become null, and true and false become booleans. A cell becomes a number only if it prints back identically, so 42 and 3.5 become numbers while 007 and 1.50 stay as text. That keeps zip codes and IDs with leading zeros intact.
The reverse trip does not rebuild nesting. A header such as address.city stays a flat key, and an array written as JSON text stays a string.
FAQ
Why are some cells empty for certain rows?
JSON records do not have to share one shape. The converter makes a column for every field it sees in any record, and leaves the cell empty for records that lack it.
What happens to null values?
By default a null, and a field missing from a record, both become an empty cell. If you switch the null setting to write the word null, both are written as null instead. The output does not distinguish a null from a missing field.
Can I get the original nested JSON back from the CSV?
Not exactly. The tool does not rebuild dotted columns into nested objects, and arrays come back as text. Treat the flat CSV as an export for spreadsheets, not a lossless copy.