Skip to content
snip tools

CSV to JSON converter

Convert CSV to a JSON array. Handles quoted fields and custom delimiters, all in your browser.

Runs 100% in your browser
 

How to convert CSV to JSON

  1. Paste your CSV. Paste CSV text, or the contents of an exported file, into the input.
  2. Set the delimiter and header. Choose comma, semicolon or tab, and whether the first row holds the column names.
  3. Copy the JSON. Copy or download the resulting JSON — an array of objects, or arrays of values with the header off.

Why you can't just split on commas

CSV is the universal export format — every spreadsheet, database and analytics tool emits it — but most code wants JSON. The reason a one-line text.split(',') isn't enough is quoting. A value like "Smith, Jane" or an address with an embedded line break is wrapped in double quotes precisely so its comma isn't a column separator. This converter follows RFC 4180: it walks the text character by character, tracking whether it's inside a quoted field, and treats a doubled quote ("") as one literal quote. That's the difference between a clean parse and a file that silently shifts every column after the first quoted comma.

Every value comes out as a string — and that's correct

You might expect 42 to become a JSON number. It doesn't — and that's deliberate. CSV has no type system; 42, 007 and true are all just text. A converter that guesses types does real damage: it strips the leading zero off a ZIP code or product ID, loses precision on long numbers, and turns the literal string "NaN" into something else. Emitting strings is lossless — you still have exactly what the file contained — so you stay in control. Cast the specific columns you need in your own code with Number() or a === "true" check.

Objects, arrays, and the round trip

With the header option on, each row becomes an object keyed by the column names — the shape most APIs and code expect. Turn it off for an array-of-arrays when there's no header row. To go the other way, the JSON to CSV converter rebuilds a spreadsheet-ready file, and the JSON formatter pretty-prints or validates the result before you hand it on.

Frequently asked questions

How does it handle commas and line breaks inside a field?
It follows RFC 4180, the de-facto CSV rules. A field wrapped in double quotes can contain commas, line breaks and quotes — a literal quote is written as two (""). The parser tracks whether it is inside a quoted field, so a comma in "Smith, Jane" stays part of the value instead of splitting the column. This is exactly the case that naive comma-splitting gets wrong.
Are numbers and booleans converted to real JSON types?
No — every value comes out as a JSON string, on purpose. CSV has no type system, so guessing types is unsafe: it silently corrupts ZIP codes and IDs with leading zeros ("01234" would become 1234), long numbers that lose precision, and strings like "NaN" or "true" that were meant literally. Keeping everything a string is lossless; cast the columns you need in your own code (Number(x), x === "true").
Does the first row become the object keys?
By default yes — the header row supplies each object's keys, so you get an array of objects. Turn off "First row is header" and you get an array of arrays (raw rows of values) instead, which is handy when the file has no header or you want positional access.
Which delimiters are supported?
Comma, semicolon and tab. Semicolon is the common delimiter in European locales (where the comma is the decimal separator), and tab handles TSV exports from spreadsheets and databases.
What happens to blank cells?
A blank cell becomes an empty string ("") in the output, preserving the column position. A trailing newline at the end of the file is ignored rather than producing an empty final record.
Is my file uploaded?
No. Parsing happens entirely in your browser — paste an export with customer data or internal IDs and none of it leaves the page.