CSV to JSON Converter
Paste a CSV export — or drop the file — and get JSON you can actually load. Quoted commas, doubled quotes, CRLF line endings, a UTF-8 BOM and an Excel semicolon export are all handled before a single key is built.
Why CSV Import Works in the Demo and Breaks on Real Data
Every CSV bug I have shipped came from the same place: a parser that was written against a five-row sample. Commas inside names, a BOM that Excel writes without asking, Windows line endings, and IDs that look like numbers but are not — none of that appears in the sample, and all of it appears in the first real export.
The Four Things That Break Imports
- Quoted delimiters.
"Smith, John"is one field, not two. Splitting on,withsplit()silently shifts every later column, soemailstarts receivingJohnand the import "succeeds" with garbage. RFC 4180 also lets a quote escape itself:"Lee, ""Ana"""isLee, "Ana". - The BOM. Excel's "CSV UTF-8" writes
EF BB BFbefore the first header, so the key is notidbut\uFEFFid. Everyrow.idlookup returnsundefined, the import reports zero errors, and the database fills with nulls. - CRLF. Splitting on
\nleaves a trailing\ron the last cell of every row, so"production\r" !== "production"and a status check falls through to the default branch. - Type coercion. ZIP code
00501, phone numbers, and 20-digit order IDs must stay strings.Number("00501")is501, and anything past 253 loses its last digits. This tool only converts a value when it is a plain decimal with no leading zero.
Delimiter and Locale Traps
A semicolon export is what you get from Excel on a machine whose locale uses the comma as the decimal separator — the same file then has 1.234,56 in a numeric column, which parses as a string, not a number. Auto-detection scores each candidate on the header line outside quotes, so a single-column file does not get misread because one address happened to contain a comma.
FAQ
- Q: Is my file uploaded anywhere?
- No. Parsing happens in your browser with plain JavaScript, so customer exports and internal tables stay on your machine. The page makes no requests after load.
- Q: Why does my first key come out as "\uFEFFid"?
- That is the UTF-8 byte-order mark Excel prepends to CSV files. This converter strips it from the start of the input, but if you parse files in your own code, use
fs.readFileSync(path, "utf8").replace(/^\uFEFF/, "")— otherwise the key never matches and every lookup silently returnsundefined. - Q: When does a value become a number?
- Only when the whole cell is a plain decimal: optional minus, no leading zero (except
0itself), no thousands separator, at most 15 digits.00501,+1 (555) 010-9999,1,234and1e5all stay strings, which is what you want for identifiers. Uncheck the box to keep every value a string. - Q: What happens with duplicate or empty headers?
- JSON objects cannot hold two identical keys, so the second
namecolumn becomesname_2— otherwise one column would vanish with no warning. Missing header cells are filled ascolumn_3, and rows shorter than the header getnull. - Q: Can I get JSON Lines for a bulk import?
- Yes — switch Output to JSON Lines and each row becomes one object on its own line, which is the format
psql COPY, BigQuery and most bulk loaders want. Newline-delimited JSON also streams row by row, so a 200 MB export does not need to be held in memory as one array.
Why Use This Converter?
No signup, no upload, no server round-trip: paste the export, pick a delimiter if auto-detection is ambiguous, and copy JSON that has already survived quotes, BOM, CRLF and number coercion. Feed the result straight into the JSON Formatter when you need to eyeball the shape.