CSV to JSON Converter

Paste your CSV or drop a file — get a clean JSON array of objects instantly, with quoted fields, delimiters and number types handled for you.

…or drop a CSV file here

Paste CSV above or drop a file to see the JSON output.

Your CSV is converted entirely inside this browser. Nothing is uploaded, and neither the file nor its contents are saved anywhere — only your option choices (header, types, delimiter, style) are remembered.

Why a simple split(",") breaks real CSV

The most common way people write a "quick" CSV parser is line.split(","), and it works right up until a value contains a comma of its own — an address, a company name like "Smith, Jones & Co.", or a number formatted "1,234". At that point the row silently splits into the wrong number of fields, and everything after the break shifts one column to the right. This tool avoids that failure mode entirely by implementing the CSV quoting rule defined in the RFC 4180 specification as a small character-by-character state machine, the same approach spreadsheet software uses internally.

The three rules that make quoting work

Worked examples

Example 1 — a comma inside a quoted value. The row "Turing, Alan",39,"Manchester, UK" has three real fields — a naive comma split would see four. This tool correctly reads it as ["Turing, Alan", "39", "Manchester, UK"], then with a header row and type detection on, the age becomes the JSON number 39.

Example 2 — semicolon-delimited export. A spreadsheet saved from a locale where the decimal separator is a comma often exports name;price;inStock with semicolons instead of commas. Auto-detect samples the first lines, sees a semicolon appearing the same number of times on every row, and parses the file correctly without you choosing anything — or you can force Semicolon from the Delimiter dropdown.

Example 3 — an identifier that looks like a number. A column of US ZIP codes containing 00501 stays the exact string "00501" with type detection on, because a leading zero means "this is an identifier, not an arithmetic quantity" — converting it to the number 501 would silently throw away a digit every time someone re-reads the JSON.

Header row vs. array output

With "First row is header" on, each row becomes a JSON object keyed by the header names — the shape almost every API and database import expects. Rows with too few columns get the missing keys filled with null (or an empty string, if type detection is off); rows with extra trailing columns keep the extra values under extra_1, extra_2… instead of silently discarding them. Turn the option off for headerless CSV — each row becomes a plain array like ["Ada", 36, true], preserving column order with no guessing.

Common CSV export quirks this tool handles

QuirkWhere it's commonHow this tool handles it
Semicolon delimiterLocales where "," is the decimal separator (much of Europe, Latin America)Auto-detected, or force it from the dropdown
Tab-separated (TSV)Copy-paste out of spreadsheets and database toolsAuto-detected the same way as comma/semicolon
EUC-KR encodingCSV exported from the Korean edition of ExcelDetected on upload with a fallback and a visible notice
Leading-zero IDsZIP/postal codes, employee IDs, phone extensionsLeft as exact strings, never coerced to a number
Ragged rowsManually edited spreadsheets, hand-written CSVPadded with null or preserved under extra_N — never silently dropped

What "Detect numbers & booleans" actually changes

Every CSV cell is plain text — there is no such thing as a "number cell" in the file format itself. When type detection is on, a cell becomes a JSON number only if it matches a plain numeric pattern with no leading zero (so 7, -3 and 0.5 convert, but 007 does not), and becomes a JSON boolean only if it is exactly true or false in any letter case. An empty cell becomes JSON null rather than an empty string, which is usually what downstream code expects for "no value." Turn type detection off for a lossless, purely textual conversion — useful when every value, including numbers, needs to stay a string for an exact round trip.

Common mistakes

Runs entirely in your browser

Parsing, delimiter detection, type inference and JSON generation all happen locally in this browser's own JavaScript engine. Nothing you paste or drop is uploaded anywhere, which matters for spreadsheets containing customer names, emails, or other personal or business data. Only your option choices are remembered in local storage for next time — the CSV content itself is never saved.

Sources & further reading

Frequently asked questions

How does this tool handle commas or line breaks inside a CSV field?

Real-world CSV often has a comma, a line break, or a quote mark inside a single value — for example a company name written "Smith, Jones & Co." or a multi-line address. This converter implements the CSV quoting rule from RFC 4180 itself as a small state machine, instead of just splitting the text on every comma. A field wrapped in double quotes can safely contain commas and line breaks, and a literal double quote inside a quoted field is written as two double quotes (""), which this tool turns back into a single ". So a row like "Smith, Jones & Co.","New York, NY" becomes two clean values, not four broken ones.

What's the difference between "First row is header" on and off?

With "First row is header" on (the default), the first line is treated as field names and every following row becomes a JSON object such as {"name": "Ada", "age": 36} — the usual shape for CSV to JSON. Turn it off if your CSV has no header row and every row is just data: the output becomes an array of arrays instead, like ["Ada", 36], with nothing guessed or renamed. Duplicate header names are automatically made unique (name, name_2, name_3…) so one column never silently overwrites another.

Why does "007" stay a string but "7" becomes a number?

When type detection is on, this converter turns a cell into a JSON number only if it looks like a plain number with no leading zero — so 7, -3 and 0.5 become numbers, but 007, 01 and similar values stay as text. That's deliberate: a leading zero almost always means the value is really an identifier, like a ZIP code, an employee number or a phone extension, and converting "00501" to the number 501 would silently lose data. The same care applies to true/false, which are only converted when a cell is exactly "true" or "false" (any letter case) — a word like "Truex" is left alone as text.

How is the delimiter (comma, semicolon or tab) detected, and can I override it?

Many countries export CSV with a semicolon instead of a comma — common where the decimal separator is itself a comma — and some exports use tabs (TSV). This tool samples the first several non-empty lines and picks whichever of comma, semicolon or tab appears the same number of times on every one of them, which is a far stronger signal than just counting the single most common character. If your file is unusual, or auto-detect guesses wrong, the Delimiter dropdown lets you force comma, semicolon or tab directly.

Is my CSV file uploaded to a server?

No. Parsing, type conversion and JSON generation all run locally in this browser's own JavaScript engine — a pasted CSV or a dropped file is never sent anywhere, which matters if your spreadsheet contains names, emails or other personal or business data. Only your option choices (header row, type detection, delimiter, pretty/minified) are kept in this browser's local storage so they're remembered next time; the CSV content itself is never saved, even locally.