DevKit

CSV to JSON

Turn a spreadsheet export into clean JSON — quoted fields, embedded commas and CRLF included.

Free No sign-up Runs in your browser
CSV in, JSON out
CSV
JSON
0Rows
0Columns
0Output bytes

CSV looks simple until it isn't

A file of comma-separated values seems trivial to parse with split(',') — and that approach breaks on the first real spreadsheet export. The CSV format (RFC 4180) allows a field to be wrapped in double quotes, and inside quotes a comma is literal data, a newline is part of the value, and a doubled quote "" means one quote character. Address fields, product descriptions and anything containing a comma all rely on this.

This converter implements a proper state-machine parser: it tracks whether it is inside a quoted field, handles CRLF and LF line endings, strips a UTF-8 BOM (which Excel loves to add), and only then maps columns to JSON keys.

Type inference, and when to turn it off

With type detection enabled, 42 becomes a number, true a boolean, and null the null value — which is usually what you want when seeding a database or a test fixture. Turn it off when leading zeros matter: a zip code 01234 or a phone number +1 555 0100 must stay a string, otherwise the zero disappears or the value becomes a float.

Duplicate headers and ragged rows

Real exports contain surprises: a column named twice, a row with an extra cell, blank trailing lines. Duplicate headers would silently overwrite each other in an object, so check your header naming before converting. Ragged rows are padded with empty strings and flagged in the status bar, which is safer than dropping data.

Where CSV still wins

CSV is the lowest common denominator of tabular data: every spreadsheet, database and analytics tool can produce and consume it, it diffs reasonably well in version control, and it stays readable without tooling. For nested structures JSON is the better transport — which is exactly why converting between the two is such a common task.

Semicolons and tabs

Excel in a European locale writes ; as the separator because the comma is the decimal mark. Tab-separated files (TSV) come out of clipboard pastes and database exports. Auto-detect counts candidates in the first line; if a file is ambiguous, pick the delimiter explicitly.

Frequently asked questions

Does it handle commas inside quoted fields?
Yes. Values wrapped in double quotes may contain the delimiter, newlines and doubled quotes. That is the main reason naive split() parsers fail on real exports.
Why did my leading zeros disappear?
Type detection turned 01234 into the number 1234. Uncheck "Convert numbers & booleans" to keep every cell as a string.
Is there a size limit?
There is no hard limit, but everything is parsed in the main thread, so files above roughly 5–10 MB will feel slow. For very large datasets, parse server-side with a streaming library.
Can it convert JSON back to CSV?
Not on this page — CSV cannot represent nested objects without flattening, so a naive round trip loses structure. Flatten your JSON first, then convert.

Related tools