How to convert CSV to JSON without breaking your data
CSV looks simple — values separated by commas, one record per line — until real-world data
shows up. A city written as New York, NY, a note containing a line break, a
quote inside a quoted field: each of these breaks naive converters that split on every comma
and every newline. This tool parses CSV the way the format actually defines it (RFC 4180),
so messy exports come out as clean, valid JSON instead of silently shifted columns.
The quoting rules, in plain English
There are only three rules, and everything else follows from them. First, a field that
contains the delimiter, a double quote, or a line break must be wrapped in double quotes:
"New York, NY". Second, a double quote inside a quoted field is written twice:
"Manchester, ""UK""" means the value Manchester, "UK". Third, a
quoted field may span several lines — the line break inside the quotes is part of the value,
not the end of the record. An unquoted field ends at the next delimiter or line break, and a
quote that appears in the middle of an unquoted field is an error, not something to guess
around.
A worked example with messy CSV
Press "Load messy example" above and you get this file — four rows that break most quick-and-dirty converters:
name,city,zip,score,active,user.role
Ada Lovelace,London,02134,92.5,true,admin
"Grace Hopper","New York, NY",10001,88,false,editor
Alan Turing,"Manchester, ""UK""",M13 9PL,97.25,true,viewer
Grace's city holds a comma, so it is quoted; Alan's city holds both a comma and quotes, so
it is quoted and the inner quotes are doubled. With "Detect numbers and booleans" on, the
output types 92.5 as a number and true as a boolean — but
02134 stays the string "02134", because turning it into a number
would silently delete the leading zero and corrupt the ZIP code. With "Nest dotted headers"
on, user.role becomes {"user": {"role": "admin"}}.
Headers: what becomes a key
By default the first row supplies the JSON keys, one per column, and every later row becomes
an object. Headers are trimmed of surrounding spaces, and an empty header becomes
column_3 (or whichever position it holds) so no value is ever lost. Duplicate
headers — two columns both called price — are kept distinct as
price and price_2 instead of one silently overwriting the other.
If your file has no header row, untick "First row is a header": the keys become
column_1, column_2 and so on, or switch to "Array of arrays" for a
plain 2D grid with no keys at all.
Nested output from dotted headers
APIs often expect nested objects, but spreadsheets are flat — so exports flatten nesting
into dotted column names like user.name and address.city.zip.
Tick "Nest dotted headers" and each dot splits one level deeper:
address.city.zip becomes
{"address": {"city": {"zip": "02134"}}}. Leave it off and the headers are kept
exactly as written, which is what you want when the receiving API expects flat dotted keys.
Note that nesting only applies to keys containing a dot; every other key is untouched.
Delimiters: not every CSV uses commas
European spreadsheet exports commonly use semicolons, because the comma is the decimal separator there. Tab-separated files come from database dumps, and pipe-separated files from logs. Auto-detect scores each candidate delimiter against the first rows and picks the one with the most consistent column count — and because detection respects quotes, a semicolon inside a quoted value never fools it. If the guess is wrong, pick the delimiter yourself from the dropdown; the preview updates instantly.
Large files and line endings
There is no file-size cap and no monthly limit: parsing happens in your own tab, so a
50,000-row export converts in well under a second on a modern machine. Windows
(CRLF), Unix (LF) and old Mac (CR) line endings are
all accepted, as is a UTF-8 byte-order mark at the start of the file — Excel's
"CSV UTF-8" export adds one, and many converters choke on it. Blank lines are skipped
silently. Very large files (hundreds of thousands of rows) still work, but the live preview
re-parses on every keystroke, so for a huge paste it is faster to upload the file and let it
convert once.
Mistakes this tool catches — and what to do about them
Unterminated quote
A field opens with " and never closes it, so the parser swallows the rest
of the file as one value. The error points at the opening quote — add the missing closing
quote there.
Stray quote mid-field
A quote in the middle of an unquoted value, like ab"cd, is illegal CSV.
Quote the whole field and double the inner quote: "ab""cd".
Wrong field count
A row with more or fewer fields than the header usually means an unquoted comma in a value, or a missing delimiter. The error names the exact line so you can count its fields.
Characters after a closing quote
After a quoted field closes, only a delimiter or a line break may follow.
"ok"x is malformed — the stray character sits at the reported column.
Leading zeros lost
Turning 02134 into a number deletes the zero. Typing here is opt-in and
conservative: leading-zero values and unsafe integers always stay strings.
Semicolon files read as one column
If every row becomes a single key, your file is semicolon- or tab-separated. Pick the delimiter from the dropdown — or leave it on auto-detect, which usually gets it right.