How to use it
- Paste CSV text, open a .csv or .tsv file, or press “Try an example”.
- Keep “Detect automatically” or pick the delimiter yourself, and say whether the first row holds column names.
- Optionally turn on detection of numbers, booleans and null, and choose objects or arrays as output.
- Copy the JSON or download it as a .json file.
How it works
The parser follows RFC 4180, the CSV specification: fields can be wrapped in double quotes, a quoted field may contain the delimiter and line breaks, and two double quotes inside a quoted field stand for one quote character. Line breaks can be CRLF (Windows), LF (macOS, Linux) or CR, and a final line break does not create an empty record. Completely empty lines are skipped. A byte order mark at the start, which Excel often writes, is removed. If a quoted field is never closed, you get an error with the line where it starts, because guessing would silently merge the rest of the file into one cell.
Automatic detection tries comma, semicolon, tab and pipe on the first rows and picks the one that gives a consistent number of columns. With a header row, each record becomes an object keyed by the column names; empty names become column_1, column_2… and repeated names get a suffix such as id_2. Rows with fewer fields than the header get empty values; extra fields get extra column names.
By default every value stays a string, which is the safe choice: postcodes like 01234, phone numbers and IDs keep their leading zeros. With type detection on, values written exactly like JSON numbers become numbers (but not 007, 1,5 or integers beyond 2^53), true and false in any letter case become booleans, and null or an empty cell becomes null. Dates are left as text.
Examples
A spreadsheet export
id,name,price\n1,Desk,149.90 converts to [{"id":"1","name":"Desk","price":"149.90"}]. With type detection on, it becomes {"id":1,"name":"Desk","price":149.9}.
European Excel files
A file saved by Excel in Germany uses semicolons: Name;Preis\nTisch;149,90. Automatic detection picks the semicolon, and 149,90 stays the string "149,90" because it is not a JSON number.
Cells with line breaks
An address cell written as "221B Baker Street London" (quoted, spanning two lines) stays one value, "221B Baker Street\nLondon", instead of starting a new row.
Frequently asked questions
Why are my numbers strings in the JSON?
CSV has no data types, so by default every value is kept as text exactly as written. Turn on “Detect numbers, true/false and null” to convert values that look like numbers. Leading zeros and decimal commas are kept as text to avoid changing data.
What if a row has more or fewer columns than the header?
Missing values become empty strings (or null with type detection on). Extra values are kept under extra keys named column_N, so no data is dropped.
Can it read Excel .xlsx files?
No, only text-based CSV and TSV. In Excel or Google Sheets, use File › Save as / Download › CSV first, then open that file here.
How large a file can I convert?
Files of several megabytes convert in a moment on a desktop computer. The limit is your device's memory, since the whole file and the JSON result are held in the browser tab.
Privacy
Your CSV is read and converted only in your browser. Files you open are not uploaded, and nothing is stored or sent to analytics.