Skip to content

Convert CSV to JSON

Convert CSV data into JSON, with headers as keys.

Runs in your browser — nothing is sent anywhere.

A real parser, not a split on commas

Most quick CSV converters split each line on commas. That works until the first quoted field containing a comma — an address, a company name, a formatted number — at which point every column after it shifts and the data is silently wrong.

This implements the actual CSV rules: quoted fields may contain the delimiter, may span multiple lines, and "" inside a quoted field means a literal quote. "Doe, John" stays one field, and "Say ""hi""" becomes Say "hi".

Delimiter detection

Left on automatic, the first non-empty line is examined and the most frequent candidate among comma, semicolon, tab and pipe is chosen. Semicolons are worth knowing about: in locales where the comma is the decimal separator, Excel exports semicolon-separated files and calls them CSV, which surprises people constantly.

Headers become keys

With headers enabled you get an array of objects keyed by column name — the shape almost every API and script expects. Without it you get an array of arrays, which preserves position when there are no meaningful names. Blank headers are given positional names rather than producing an empty key that would collide.

Everything stays a string

Values are not converted to numbers or booleans, and that is deliberate. Automatic type inference is where data quietly breaks: leading zeros vanish from postcodes and IDs, long numbers lose precision, and values like NA or 1-2 get mangled into dates. Cast explicitly on the far side, where you know what each column means.

The other direction

JSON to CSV converts back, taking the union of keys so rows with extra fields are not truncated.

01

Common questions

Does it handle commas inside quoted fields?

Yes. It implements the real CSV rules, including quoted delimiters, newlines inside fields, and "" as an escaped quote.

Why is my file semicolon-separated?

In locales where the comma is the decimal separator, Excel exports with semicolons. Automatic detection handles it.

Why are numbers strings in the output?

Deliberately. Type inference strips leading zeros from IDs and mangles values like NA — cast explicitly instead.

What if my CSV has no header row?

Turn off the header option and you get an array of arrays.

Is my data uploaded?

No. Parsing happens in your browser.