Processed entirely on your device — nothing is uploaded
How to use the csv to json converter
- 1Drop a CSV or JSON file, or paste the content in.
- 2Pick a direction; the delimiter is detected automatically.
- 3Choose whether the first row is a header and whether to type values.
- 4Copy or download the result.
Why most CSV converters are broken
CSV looks like the simplest format in existence, which is exactly why so many tools handle it badly. The naive implementation splits each line on commas, and that fails on the first real export you feed it.
Three things break it. A field containing a comma is wrapped in quotes — `"Hopper, Grace"` is one field, not two, and splitting produces a corrupted row. A field containing a quote escapes it by doubling — `"say ""hi"""` is the text `say "hi"`. And a quoted field may contain a line break, so a single record can span several lines and splitting on newlines shreds it.
This parser implements RFC 4180 properly, walking the text character by character and tracking whether it is inside a quoted field. The result is that real exports from Excel, Google Sheets, a database dump or a CRM come through intact — including the addresses with commas and the notes fields with line breaks that break everything else.
Delimiters are not always commas
The C in CSV is optimistic. Exports from European locales routinely use semicolons, because the comma is the decimal separator there — a spreadsheet saved as CSV in a German or French locale is semicolon-delimited, and feeding it to a comma parser puts every row in one field.
Tab-separated files are common from databases and older systems, and pipe-delimited files turn up in finance and telecoms.
The delimiter is detected here by counting candidates in the header line, which is right nearly always. When it is not — a header with commas inside quoted names, for instance — set it explicitly.
Type conversion, and when to switch it off
CSV has no types. Everything is text, and a converter must decide whether `42` becomes the number 42 or the string "42". Producing real JSON types is usually what you want, so it is on by default.
There is one case where automatic typing destroys data, and it is common enough to guard against explicitly: identifiers with leading zeros. Postcodes, product codes, phone numbers, account references and country codes frequently start with a zero, and converting `007` to the number 7 loses information irrecoverably. This converter keeps any value with a leading zero as a string for that reason.
Very large integers are the other hazard. JavaScript numbers lose precision beyond about 9 quadrillion, so a 19-digit identifier converted to a number comes back subtly wrong — the classic symptom being an ID that changes value on a round trip. Those are kept as strings too.
If your data is all identifiers and codes, turn typing off entirely and get strings throughout.
Going the other way
JSON to CSV has its own problem: JSON is hierarchical and CSV is flat. An array of flat objects converts cleanly. Nested objects and arrays do not, and this converter serialises them as JSON strings inside the cell rather than silently dropping them or inventing column names.
Rows with different keys are handled by taking the union of every key across the whole array, so an object missing a field gets an empty cell rather than a shifted row. That is more forgiving than most implementations, which take the first object's keys and quietly lose everything else.
Fields containing the delimiter, a quote or a newline are quoted and escaped on the way out, so the CSV this produces can be read back by any conforming parser — including this one, which is worth testing if the data matters.
Frequently asked questions
Does this handle commas inside quoted fields?
Yes. The parser follows RFC 4180 — quoted fields may contain the delimiter, doubled quotes and line breaks, all of which break naive split-based converters.
My file uses semicolons. Will it work?
Yes. The delimiter is detected from the header line, and semicolon exports from European locales are common. You can also set it manually.
Why did my postcode 007 stay a string?
Deliberately. Converting it to the number 7 would lose the leading zero irrecoverably. Values with leading zeros and very large integers are kept as strings.
What happens to nested JSON?
Nested objects and arrays are serialised as JSON strings inside the cell, rather than being dropped or flattened into invented column names.
What if rows have different fields?
The header is the union of all keys across the array, so a missing field becomes an empty cell rather than shifting the row.
Is my data uploaded?
No. Parsing and conversion happen in your browser, which matters when the file is a customer export.