CSV → JSON

Convert CSV data into JSON

Turn a spreadsheet export into an array of JSON objects, using the first row as the keys. The parser handles the parts of CSV that trip up naive splitting: quoted fields containing commas, escaped quotes, and both Windows and Unix line endings.

How to use it

  1. Paste your CSV, including the header row.
  2. Conversion runs automatically and produces one JSON object per data row.
  3. Check that the keys match your headers and the types look right.
  4. Copy the JSON output.

Frequently asked questions

Are quoted fields containing commas handled?

Yes. Fields wrapped in double quotes may contain commas, line breaks and escaped quotes written as two double quotes in a row. This is where splitting on commas naively falls apart.

How are numbers and booleans treated?

Values that look like numbers, true, false or null are converted to those JSON types. Everything else stays a string. Note that values with leading zeros, such as postcodes and identifiers, are deliberately kept as strings so the zeros survive.

What if my file has no header row?

The first row is always treated as headers. Add a header row before converting, or accept that your first data row will be consumed as key names.

Why is a long numeric ID coming out wrong?

Very long numbers exceed the precision JavaScript can represent exactly. If you are working with large identifiers, wrap them in quotes in the CSV so they are preserved as strings.