This tool runs in your browser using JavaScript. If it does not appear, please enable JavaScript or reload the page. The description below explains how it works.
CSV to JSON
Turn comma-separated values into valid JSON in one step. Copy a table from a spreadsheet or a database export, choose a delimiter and a header option, and the tool converts every row into a clean JSON object. Quoted fields, escaped quotes, embedded line breaks and CRLF endings are handled automatically, so exports that came straight from Excel round-trip without mangled cells. Empty lines are skipped, and when a quoted field is never closed, the tool reports the exact line where the trouble starts instead of producing garbage.
How to use
- Paste your CSV into the text area. A small sample is pre-filled so you can try the conversion immediately.
- Pick the delimiter — comma, semicolon or tab. German spreadsheet exports favor semicolons, US exports favor commas; both are a single click.
- Decide on the header — if the first row lists column names, leave "First row is header" checked so the objects are keyed with those names.
- Enable type inference if you want
1,trueandnullto become real numbers and booleans instead of quoted strings. - Read the result on the right as pretty-printed, indented JSON, and copy it with one click.
The conversion follows the common CSV rules: a field wrapped in double quotes may contain the delimiter, doubled quotes ("") write a literal quote, and both \n and \r\n line endings are accepted. Without a header row the columns are named 1, 2, 3 and so on, matching the column positions.
What "infer types" changes
The default mode keeps everything as strings, which is the safest representation. With type inference turned on, each cell is examined individually:
- A trimmed value of
trueorfalsebecomes a boolean. - A trimmed value of
nullbecomes JSONnull. - A trimmed value that is a plain decimal number becomes a number — but only if it has no leading zero, so
01stays the string"01"and cannot silently lose its zero. - Anything else — text, dates, codes with leading zeros — stays exactly as typed.
This nuance matters more than it looks: product numbers like 0045 must survive as strings, while a column of amounts should become numbers for further processing in JavaScript, Python or a data pipeline.
Formatting details
The output is indented by two spaces, so it reads well in editors and code reviews, and it is always valid JSON that any standard parser accepts. If the input is only a header or completely empty, the tool emits an empty array rather than an error. Abnormally short rows — a line with fewer columns than the header — are filled with empty strings, and abnormally long rows gain extra numbered keys, so the conversion never stops halfway through your file.
Example uses
- Spreadsheet to API payloads: export a Google Sheets or Excel tab, convert it, and paste the resulting array directly into a request body.
- Configuration tables: turn a small lookup table of currencies, regions or status codes into a JavaScript object or JSON file.
- Testing and fixtures: hand-convert tricky rows with commas and quotes into test fixtures without writing JSON by hand.
- Data cleanup: check whether your export contains CRLF line endings, quoted commas or blank lines — the tool reveals all three at a glance.
- Learning: see exactly how a flat CSV row maps to a nested-free JSON object.
Where the numbers end up
Because the conversion happens entirely in your browser, spreadsheets, phone numbers and other personal data never leave your machine. There is no upload step and no server round trip — paste, convert, copy, done.