CSV to JSON Converter

Turn a CSV table into a JSON array of objects, entirely in your browser.

Runs entirely in your browser. Nothing is uploaded, logged or stored.

Paste a spreadsheet export and get a JSON array back, one object per row, keyed by the column names. It happens in your browser, so a file full of customer records, salaries or order lines never leaves your machine.

How it works

The document is read character by character following RFC 4180, which is what lets a field contain the delimiter, a line break or a quote of its own: anything inside double quotes is literal, and a doubled quote is one quote. Splitting on commas and newlines would break on the first address field containing a comma.

The first row becomes the column names unless you say otherwise, in which case every row comes back as an array instead of an object. A name that is blank becomes column_1, column_2 and so on by position, and a name that repeats gets a numeric suffix, because two identical keys in one object means the first column silently disappears.

Every value arrives as a string, because CSV has no types. Reading types instead is a checkbox rather than the default: inference is what turns a product code of 007 into the number 7. When it is on, it is deliberately cautious — a leading zero, a leading plus or a surrounding space all keep the value a string, and so does an integer too large to survive as a double.

Examples

Case Input Result
A quoted field containing the delimiter name,city "Doe, John",Geneva [ { "name": "Doe, John", "city": "Geneva" } ]

Frequently asked questions

My file uses semicolons. Is that still CSV?

Yes, and it is the normal case in much of Europe. A spreadsheet saving CSV in a locale that writes decimals with a comma cannot also use the comma as a separator, so it uses the semicolon instead. Pick it from the delimiter list; the tab and the pipe are there for the same reason.

Why did my postcode lose its leading zero?

It did not, unless you asked for type inference. Without it every value stays a string exactly as written. With it on, values that begin with a zero are still kept as strings for precisely this reason, along with anything beginning with a plus or padded with spaces.

What happens to a row with the wrong number of fields?

A short row is padded with empty strings, because a trailing empty field is routinely dropped by whatever wrote the file. A long row keeps its extra values under positional names rather than dropping them, so nothing disappears without you seeing it.

Is my file uploaded anywhere?

No. The page loads a small script that parses the document locally. You can disconnect from the network after the page has loaded and the tool keeps working.

Good to know

  • Everything happens in your browser. The document is not uploaded, not logged and not stored.
  • Quoting follows RFC 4180: a field is quoted when it contains the delimiter, a double quote or a line break, and a double quote inside a quoted field is written twice. Backslashes are ordinary characters and are never treated as escapes.

Sources

All Code tools