JSON ↔ CSV Converter
Paste JSON to get CSV, or CSV to get JSON. Nested objects flatten into dotted column names and expand back again, so a round trip returns the shape it started with.
Press Esc to clear
CSV
About the JSON ↔ CSV Converter
CSV is flat and JSON is not, and that mismatch is the entire difficulty of converting between them. An object with a nested address cannot become a single column, so it becomes several: user.address.city, user.address.postcode. Arrays become indexed columns in the same way. Going the other direction, those dotted names are expanded back into real nesting, which means a round trip through CSV and back returns the structure you started with rather than a flattened approximation.
The column set is the union of every key across every row, not the keys of the first row. That distinction matters on real exports, where records are routinely missing fields — a tool that reads the first object and assumes the rest match will silently drop every field that only appears later in the file.
Type coercion on the way back into JSON is deliberately conservative. Numbers and booleans are converted, empty cells stay empty strings, and anything ambiguous stays a string. A value like 007 stays text, because a zero-padded value is an identifier far more often than it is the number seven — and turning it into 7 is the kind of quiet data corruption that surfaces weeks later.
Quoting is handled properly in both directions. Values containing a comma, a quotation mark or a line break are quoted and escaped on the way out, and parsed character by character on the way in, so a field containing a comma survives instead of splitting the row.
Everything runs locally in your browser.
Frequently asked questions
How are nested objects handled?
They are flattened into dotted column names such as user.address.city, and expanded back into nested objects when converting the other way. A round trip returns the original structure.
What happens to rows that are missing fields?
Nothing is lost. The column set is the union of keys across every row, so a field that only appears in later records still gets a column, with empty cells where it is absent.
Why is 007 not converted to a number?
Because a zero-padded value is almost always an identifier rather than a number. Converting it would silently change your data, so it stays a string.
You might also need
- Developer
JSON Formatter & Validator
Pretty-print, minify and validate JSON, with the error pinned to a line and column.
- Developer
YAML ↔ JSON Converter
Convert between YAML and JSON in both directions, with a warning about lost comments.
- Text
Markdown Table Builder
Build a Markdown table in a grid, or paste CSV and spreadsheet data and get one out.