CSV to JSON Converter

Convert CSV or tab-separated data into JSON in your browser, with proper handling of quoted fields, embedded commas and line breaks.

Paste your rows and get JSON back. Quoted fields containing commas, quotes or line breaks are parsed correctly, not split down the middle.

  • 0Rows
  • 0Columns
  • Separator used

How Does It Work?

  1. Paste your CSVStraight out of a spreadsheet, an export or a text file. The separator is detected automatically, or you can force comma, semicolon, tab or pipe.
  2. Choose the shapeAn array of objects uses the first row as keys, which is what most APIs expect. An array of arrays keeps every row as a plain list, header included.
  3. Copy the JSONIndented for reading or minified for pasting into code. Numbers are converted by default; booleans and nulls are optional.

What Is It Used For?

Naively splitting a CSV line on commas breaks the moment a field contains one — which is constantly, because addresses, names and descriptions all do. The convention, set out in RFC 4180, is that such fields are wrapped in double quotes, and a literal quote inside them is written twice. This parser implements that properly, so "Smith, John" stays a single field and a cell containing a line break does not silently become two rows. European exports that use semicolons, and spreadsheet copy-paste that uses tabs, are handled too.

  • Turning a spreadsheet export into JSON for an API or a script.
  • Converting data copied straight out of a spreadsheet, which arrives tab-separated.
  • Checking that a CSV parses the way you expect before importing it somewhere.
  • Reshaping a semicolon-separated European export into standard JSON.
  • Preparing seed or fixture data for a test suite.

Examples

CSV inputOutput shapeResult
name,age / Ada,36Array of objects[{"name":"Ada","age":36}]
"Smith, John",MadridArray of arrays[["Smith, John","Madrid"]]
a;b / 1;2Semicolon detected[{"a":1,"b":2}]
x,y / 1,Empty cells as null[{"x":1,"y":null}]

Frequently Asked Questions

How are commas inside a field handled?

A field wrapped in double quotes may contain the separator, line breaks and quotes. So "Smith, John" is parsed as one value rather than two, exactly as the RFC 4180 convention specifies and as spreadsheets export it.

How do I include a quote character in a value?

Double it inside a quoted field. The CSV fragment "She said ""hello""" parses to the single value: She said "hello". The parser handles this correctly.

Why are my numbers becoming strings, or vice versa?

The "Convert numbers" option turns anything that looks like a plain number into a JSON number. Turn it off to keep everything as text, which matters for values such as postcodes, phone numbers and IDs with leading zeros.

What happens if a row has fewer cells than the header?

Missing cells are filled with empty values so the object still has every key, and a notice tells you how many rows were ragged. That is usually a sign of an unquoted separator somewhere in the source data.

Is my data uploaded?

No. The parsing runs entirely in your browser, which matters because CSV exports so often contain customer names, email addresses or financial figures.

Can it handle a file rather than pasted text?

Not yet — paste the contents for now. For very large files a spreadsheet or a command-line tool will be more comfortable than a browser text box.

Free. No registration. This tool runs entirely in your browser, so the data you enter stays on your device.