CSV to JSON converter

Paste CSV and get a clean JSON array, with quoted fields, embedded commas and escaped quotes handled properly.

How the conversion works

CSV stores a table as plain text: one row per line, fields separated by commas. JSON stores structured data as objects and arrays. This converter reads your CSV row by row and, with the header option ticked, turns the first row into keys and every following row into an object, giving you an array ready to feed to an API, a script or a database import. Untick the option and you get an array of arrays instead, one per row, which suits files with no header line.

The part that separates a real converter from a quick split-on-comma script is quoting. Real-world CSV wraps awkward fields in double quotes so they can contain commas, line breaks and quotes of their own. This parser follows those rules properly, so a company called "Fortnum, Mason & Sons" comes through as one field, not three. Everything happens in your browser: the customer lists and exports you paste are never uploaded anywhere.

Worked examples

name,city then Ada,London
[{"name": "Ada", "city": "London"}]
A comma inside quotes: "Smith, John",42 under headers name,age
{"name": "Smith, John", "age": "42"}, one field, not two
A quote inside quotes: "She said ""hello"""
She said "hello", because a doubled quote means one literal quote

The quoting rules in 30 seconds

The rules come from RFC 4180, the closest thing CSV has to an official standard. A field needs quoting when it contains a comma, a double quote or a line break. To quote it, wrap the whole field in double quotes. To include a literal double quote inside a quoted field, write it twice. That is the entire grammar, and it is why "She said ""hello""" decodes to a single field containing one pair of quotes.

Where files go wrong, the converter tells you rather than guessing. An opening quote that never closes reports the line it started on, which is usually where someone hand-edited an export. Text appearing after a closing quote, like "abc"def, is also flagged, because the correct form is to quote the whole field. Rows with fewer fields than the header are padded with empty strings, and rows with extra fields get generated keys such as column_4, so nothing is silently dropped.

Why everything comes out as strings

CSV has no types. Every field is just text, and the converter keeps it that way instead of guessing which fields ought to be numbers, booleans or dates. Guessing is how phone numbers lose their leading zeros, how the product code 1e5 becomes 100000, and how "TRUE" in a free-text column turns into a boolean nobody asked for. Spreadsheet users will recognise this pain: it is the same reason gene names famously got mangled into dates by Excel.

If your pipeline needs real numbers, convert the specific columns you trust after parsing, where you can decide deliberately how to treat blanks and bad values. One more portability note: some locales export "CSV" with semicolons as separators, because the comma is their decimal mark. This tool expects genuine comma-separated values, so re-export with commas if your file looks like one long field per row. And once your JSON is out, the JSON formatter linked below will pretty print or minify it for wherever it is headed next.

Frequently asked questions

Is my data uploaded anywhere?

No. The conversion runs entirely in your browser with JavaScript, so exported customer lists, financial data and anything else you paste never leave your device. That is the whole point of doing it client side.

How are commas inside values handled?

The parser follows the standard CSV quoting rules. A field wrapped in double quotes can contain commas and even line breaks, and a double quote inside a quoted field is written as two double quotes. All of that is unwrapped correctly rather than split naively on every comma.

What does the first row is headers option do?

When ticked, the values in the first row become the keys of each JSON object, so a name column produces objects with a name property. When unticked, every row including the first becomes a plain array of strings, which suits files that have no header row.

Why are all my numbers in quotes in the output?

CSV has no types, so every field arrives as text and the converter keeps it as a string rather than guessing. Guessing goes wrong quickly: phone numbers lose leading zeros and product codes like 1e5 turn into 100000. If you want real numbers, convert the specific fields you trust after parsing.

My file uses semicolons instead of commas. Why?

Spreadsheet software in many European locales exports with semicolon separators because the comma is used as the decimal mark. This tool expects genuine comma-separated values, so either re-export with commas or do a careful find and replace first, watching out for semicolons inside quoted text.

Related tools