CSV to JSON Converter
A comma is not the only separator. Excel in Europe exports semicolons, and a leading zero in a zip code is data until JSON turns it into a number.
A comma is not the only separator. Excel in Europe exports semicolons, and a leading zero in a zip code is data until JSON turns it into a number.
Paste the CSV. Check the first object. If 06401 became 6401, the types are wrong, not the file.
How to use it
- RFC 4180 is comma-separated,
"to quote, doubled""for a literal quote. If your file uses;, that's EU Excel. Switch the delimiter before you convert. - Keep leading zeros as strings. Zip codes, phone numbers, account IDs. A number has no leading zero.
- A header row becomes keys. Two headers with the same name collide. Empty headers become
field2,field3, not useful names. - NDJSON (one JSON object per line) is not CSV. If every line already starts with
{, you're in the wrong tool.
When it breaks
- A newline inside a quoted field is legal CSV and looks like a broken row. Don't split on
\nyourself. - Mixed line endings (CRLF from Windows Excel) usually parse. A stray UTF-8 BOM in the first key does not. If the first key is
\ufeffName, strip the BOM. - This does not make a schema. Types are guessed. Guessing is how zip codes die.
CSV
JSON
Features
- RFC 4180 quoted fields: commas and newlines inside quotes stay in the cell
- Delimiter detect for comma vs EU Excel semicolon vs tab
- Every cell stays a string so ZIP codes keep leading zeros
- Output is a JSON array of objects, not NDJSON (one object per line)
Common Use Cases
- Turn a German Excel CSV (semicolon, decimal comma in the UI) into JSON
- Keep 07701 as a string instead of the number 7701
- See how a quoted comma does not split a column
- Know you got an array, not newline-delimited JSON, for fetch().json()
A comma is not the only separator
A comma is not the only separator. Excel in Europe exports semicolons, and a leading zero in a zip code is data until JSON turns it into a number.
Paste the CSV. Check the first object. If 06401 became 6401, the types are wrong, not the file.
RFC 4180 is comma-separated, " to quote, doubled "" for a literal quote. If your file uses ;, that's EU Excel. Switch the delimiter before you convert. Keep leading zeros as strings. Zip codes, phone numbers, account IDs. A number has no leading zero.
A header row becomes keys. Two headers with the same name collide. Empty headers become field2, field3, not useful names. NDJSON (one JSON object per line) is not CSV. If every line already starts with {, you're in the wrong tool.
Examples
name,city
"Lovelace, Ada",Londonid;stadt
1;Münchenzip,name
07701,Ada[{"zip":"07701","name":"Ada"}]name,city
"Ada,LondonFrequently Asked Questions
A comma is not the only separator. Excel in Europe exports semicolons, and a leading zero in a zip code is data until JSON turns it into a number. Paste the CSV. Check the first object. If 06401 became 6401, the types are wrong, not the file. Keep leading zeros as strings. Zip codes, phone numbers, account IDs. A number has no leading zero.
RFC 4180 is comma-separated, " to quote, doubled "" for a literal quote. If your file uses ;, that's EU Excel. Switch the delimiter before you convert.
A header row becomes keys. Two headers with the same name collide. Empty headers become field2, field3, not useful names. NDJSON (one JSON object per line) is not CSV. If every line already starts with {, you're in the wrong tool.
A newline inside a quoted field is legal CSV and looks like a broken row. Don't split on \n yourself. Mixed line endings (CRLF from Windows Excel) usually parse. A stray UTF-8 BOM in the first key does not. If the first key is \ufeffName, strip the BOM. This does not make a schema. Types are guessed. Guessing is how zip codes die.
Common Mistakes
Tips
- Keep a header row. Headerless CSV becomes column_1, column_2.
- If Excel opened the CSV and wrecked leading zeros, convert from the original export, not the resaved xlsx.
- Do not paste NDJSON logs into a CSV converter.