CSV to JSON Converter
CSV and JSON get treated as interchangeable, and for a flat table of strings they nearly are. The moment your data contains nested objects, embedded commas, or values like 007 that only look numeric, the two formats stop agreeing. This page converts in both directions and documents exactly where the translation is lossy.
How to use it
- Pick a direction: CSV to JSON, or JSON to CSV.
- Drop the file into the workspace. Parsing happens in the page, so nothing is uploaded.
- The converted file downloads immediately, named after your original.
What happens to your data during the conversion
Going from CSV to JSON, the first row is treated as the header and becomes the object keys. Every subsequent row becomes one object in a top-level array, so a 500-row spreadsheet produces an array of 500 objects. Fields are parsed according to RFC 4180 quoting rules, which means a value wrapped in double quotes can legally contain commas, line breaks, and escaped quotes without breaking the row.
Going the other direction, JSON to CSV, the converter expects an array of objects. It collects the union of keys across every object to build the header row, so objects with missing keys produce empty cells rather than shifted columns.
Where CSV and JSON genuinely cannot round-trip
CSV has no type system. Every value in a CSV file is text, and any typing you see is inferred by whatever reads it. This is the source of most conversion surprises.
The specific failure modes worth knowing about:
- Leading zeros. A ZIP code of 07030 or a part number of 000451 is a string in JSON but will be re-read as the number 7030 or 451 unless the consuming tool is told otherwise. Excel does this too, which is why so many exported CSVs arrive already damaged.
- Nesting. JSON can express an object inside an object inside an array. CSV is strictly two-dimensional. Converting nested JSON to CSV requires either flattening keys into dotted paths or serialising the branch back into a JSON string inside one cell. Neither survives a return trip cleanly.
- Nulls versus empty strings. CSV writes both as nothing at all. Once converted, there is no way to recover which was which.
- Very large integers. Values beyond 2^53 lose precision when parsed as JavaScript numbers. Account numbers and snowflake IDs are the usual casualties, and the damage is silent.
Encoding and delimiter issues that break parsers
Files exported from Excel on Windows frequently begin with a UTF-8 byte order mark. That BOM becomes part of the first header key, so you get a key that looks identical to id but does not match it. The converter strips a leading BOM before parsing.
Regional Excel installations also export semicolon-delimited files while still calling them CSV, because the comma is the decimal separator in much of Europe. If your output arrives as a single column, open the file in a text editor and check the delimiter before assuming the converter failed.
At a glance
| Accepted input | .csv, .json |
|---|---|
| Quoting | RFC 4180, including embedded commas and newlines |
| Header handling | First CSV row becomes object keys |
| Runs on | Main thread, no upload |
Frequently asked questions
Why did my ZIP codes lose their leading zeros?
Because CSV cannot distinguish the string "07030" from the number 7030. Whatever reads the CSV decides, and most tools guess number. If you need the zeros preserved, keep the data as JSON, or quote the field and use a reader that respects quoting as a type hint.
My JSON is nested. What happens when I convert it to CSV?
Nested branches are serialised into a single cell as JSON text rather than being silently dropped. You keep the data, but the structure is no longer addressable as columns. If you need genuine columns, flatten the JSON first so that every leaf value has its own top-level key.
Can it handle a CSV where a field contains a line break?
Yes, provided the field is double-quoted, which is what RFC 4180 requires. Unquoted line breaks are genuinely ambiguous and no parser can resolve them correctly.
Is there a row limit?
There is no fixed limit, but the whole file is held in browser memory during parsing. Files in the tens of megabytes are fine on a normal machine; multi-hundred-megabyte exports are better handled by a streaming parser outside the browser.
Read more
CSV, JSON, YAML, XML: choosing a data format — Every conversion between these formats loses something. Knowing what, in advance, prevents most of the resulting bugs.