About the CSV to JSON Converter
Convert spreadsheet exports to JSON for your code, or turn a JSON API response into a CSV you can open in Excel or Google Sheets. Paste the data or open a file, and the converted result appears instantly.
The converter auto-detects the delimiter (comma, semicolon, tab or pipe), handles quoted fields with commas and line breaks inside them, and can turn numbers, true/false and empty cells into proper JSON types. Everything runs locally in your browser — nothing you paste is sent to a server.
Last reviewed November 21, 2026
How the delimiter is detected
There is no reliable marker in a CSV file that says which separator it uses, and spreadsheet apps in many European locales export with semicolons because the comma is their decimal separator. In Auto mode the converter takes the first 10 non-empty lines and, for each candidate (comma, semicolon, tab, pipe), counts how often it appears outside double quotes on each line. A candidate scores zero unless it appears on every line; otherwise its score is 10 × the smallest count, minus the spread between the largest and smallest count. The highest score wins, and ties go to the earlier candidate in that order.
This rewards a character that appears the same number of times on every line, which is what a real delimiter does. Two consequences follow:
- A single-column file has no delimiter on any line, so every candidate scores zero and comma is used by default. If the values contain commas (for example 1,50 written with a decimal comma), each row splits in two. The extra values are kept under a “column2” key and the tool warns that some rows are wider than the header — the sign to choose the delimiter manually for single-column data.
- Quotes are counted line by line, so a quoted field containing a line break can throw off the counts for those lines. If detection picks the wrong character, set it yourself.
Worked example: a semicolon export
Input:
sku;name;price;zip;in_stock / A-01;"Desk; oak";149.90;02134;true / A-02;"Lamp ""Arc""";39;10001;FALSE / A-03;Chair;;0;null (each / is a line break)
Semicolon is detected (it appears four times outside quotes on every line). With the header row and type inference on, the output is:
| Row | name | price | zip | in_stock |
|---|
| 1 | "Desk; oak" | 149.9 | "02134" | true |
| 2 | "Lamp \"Arc\"" | 39 | 10001 | "FALSE" |
| 3 | "Chair" | null | 0 | null |
Each detail follows RFC 4180 and the inference rules: the semicolon inside quotes stays part of the name; a doubled quote "" becomes one literal quote; 149.90 becomes the number 149.9; 02134 keeps its leading zero by staying a string, while 10001 becomes a number, so one column ends up with mixed types; FALSE stays a string because only lowercase true, false and null are converted; and the empty price becomes null.
What type inference will and will not do
- Converts numbers written the JSON way: 42, -7, 3.5, 1e3 (to 1000).
- Leaves as text anything that would lose information: leading zeros (02134), integers beyond 2^53 such as 12345678901234567890, and forms JSON does not allow like +5 or 1,5.
- Drops trailing zeros: 3.10 becomes 3.1. Version numbers and fixed-decimal codes therefore need inference switched off.
- Turns empty cells, and cells missing at the end of a short row, into null (or "" with inference off).
Other rules worth knowing
- Headers are made safe: an empty header becomes column1, column2 and so on by position, and duplicates get suffixes, so a,a,,b becomes a, a_2, column3, b.
- Quotes only open a field at its start. A quote in the middle of an unquoted field, as in 5" monitor, is kept as text. A missing closing quote is reported with the line on which the quoted field began.
- Line endings and BOM: CRLF, LF and lone CR are all accepted, a leading byte order mark is removed, and blank lines are skipped.
- JSON → CSV: the header is the union of keys from every object, in first-seen order, so objects with different fields still line up; missing values become empty cells. Nested objects and arrays are written as JSON text. Cells containing the delimiter, quotes, line breaks or leading or trailing spaces are quoted, rows end with CRLF as RFC 4180 specifies, and the downloaded file starts with a UTF-8 byte order mark so Excel detects the encoding.
Spreadsheet safety: a cell that starts with =, +, - or @ can be executed as a formula when the CSV is opened in Excel or Sheets. The converter writes values unchanged, so if your JSON contains user-supplied text, sanitise it before sharing the CSV. OWASP calls this CSV injection.
To inspect or tidy the JSON output, paste it into the JSON formatter. Large numeric IDs in the source are worth checking there too, for the precision reasons explained on that page.
How to use the CSV to JSON Converter
- Choose CSV → JSON or JSON → CSV.
- Paste your data or open a .csv or .json file.
- Adjust the delimiter, header and type options if needed.
- Copy the result or download it as a file.
Frequently asked questions
What JSON structure does it produce?
With “First row is a header” on, each row becomes an object whose keys are the column names. With it off, you get an array of arrays.
What JSON can be converted to CSV?
An array of objects (keys become columns) or an array of arrays. Nested objects and arrays inside a cell are written as JSON text.
Why are my zip codes still text?
Numbers with leading zeros, like 01234, are kept as text on purpose so that no information is lost.
Will the CSV open correctly in Excel?
Yes. Downloaded CSV files include a UTF-8 marker so Excel shows accented and non-Latin characters correctly.