Skip to content

CSV to JSON converter

Paste CSV. The first row is the header unless you choose otherwise.

Quoted fields keep commas and line breaks. An unclosed quote is an error, and no JSON is written.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

Header
JSON output
CSV input
JSON output

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste CSV, or load the sample. The sample header is name,city.
  2. Choose Header row to make objects, or No header to make arrays of fields.
  3. Copy or download the JSON only after the status says the conversion succeeded.

Supported formats and limitations

  • Fields are separated by commas. A comma inside quotes is part of the field.
  • A doubled quote inside a quoted field is one quote character.
  • With a header row, every data row must have the same number of fields. Duplicate or empty headers are errors.
  • Without a header, the result is an array of arrays. Field counts may differ.
  • Every cell stays a string. 8080 is not turned into a number.

Examples

A quoted comma

The city stays one field because the comma is inside quotes.

name,city
Grace,"New York, NY"

A quote inside a field

A doubled quote inside quotes is one quote in the JSON string.

note
"say ""hello"""

Common errors and solutions

Unclosed quote
Add the closing quote, or escape an interior quote by doubling it.
Duplicate header
Rename one of the columns. The converter does not merge them.
Row length does not match the header
Add the missing comma-separated field, or remove the extra one.

FAQ

Why is every cell a string?
CSV has no types. The JSON keeps the characters from the file.
Does the first row have to be a header?
No. Choose No header when the first row is data. The result is then an array of arrays.
Is the file uploaded?
No. Parsing happens in your browser.

Related tools

  • JSON to CSV converter

    Convert a JSON array of objects or arrays to CSV in the browser. Nested values are rejected instead of being encoded.

  • JSON formatter

    Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.

  • JSON Schema validator

    Check a JSON document against a JSON Schema in the browser. Draft-07 and 2020-12 are supported, and remote $ref values are not fetched.