CSV to JSON Converter

Convert comma-separated data with a header row into a JSON array of objects, keeping every cell value as text.

Text is processed locally in your browser and is not uploaded.

Records
2
Columns
2

How to use this tool

  1. Paste CSV with column names in the first row.
  2. Use commas as delimiters and double quotes around fields containing commas or newlines.
  3. Select Convert to JSON. Resolve any header or row-length error before copying the output.

Understanding the output

Each data row becomes an object whose keys come from the trimmed headers. Cell values stay strings, including empty cells, leading-zero identifiers, and values that look like numbers or booleans. This avoids guessing data types from appearance.

Preserving an identifier

The CSV id,name followed by 001,Ada becomes an object with "id": "001" and "name": "Ada". The leading zeroes remain because the converter does not turn 001 into a number.

Use consistent headers and row widths

A header names a field in every JSON record. Empty or repeated header names would create ambiguous objects, so this converter rejects them after trimming the header edges. Every following row must have the same number of fields. A missing final value should be represented by a trailing comma rather than by omitting the field entirely.

A blank data row is still a row. In a multi-column table it can trigger a width error, which helps reveal accidental blank records. A final line ending after the last complete record is accepted and does not create an extra record.

Quoted CSV is different from splitting on commas

A field such as "New York, NY" contains a comma that belongs to the value. CSV can also contain a newline inside a quoted field and doubled double quotes representing one literal quote. The parser tracks these quoted regions rather than splitting the source blindly. It accepts standard comma-separated input, not semicolon-separated exports or arbitrary spreadsheet formats.

Method and supported input

A stateful CSV parser handles quoted fields, escaped quotes, CRLF or LF record endings, and an optional UTF-8 byte-order marker. The first record supplies trimmed unique keys.

  • The first record is a header, and the delimiter is a comma.

Limitations

  • Values remain strings; type conversion must be explicit in the receiving application.
  • Input is limited to 10,000 CSV records and 100,000 characters.

Common questions

Why does true remain a string?

Automatic type inference can alter identifiers and other data. This converter deliberately preserves the cell text.

Can I paste a semicolon-separated file?

Not directly. Export it with comma delimiters or convert the delimiter using a data-aware editor.

Sources and further reading