Skip to main content

CSV to JSON Converter with Header Options

Convert CSV rows into JSON objects with the available header and delimiter options. Inspect quoted fields and inferred types before using the output.

CSV to JSON Converter workspace

RFC 4180 Correctness

Quoted commas, escaped quotes ("" → "), and newlines inside quoted fields are parsed exactly to spec — the edge cases that corrupt naive split-on-comma converters.

Auto-Detect Delimiter

Leave it on Auto and the parser scans the first row to pick comma, semicolon, tab, or pipe. Override it any time to force a specific delimiter.

Smart Type Inference

Opt in to turn "123" → 123, "true" → true, and empty cells → null. Leading-zero IDs and 19-digit numbers stay strings, so nothing rounds or loses a zero.

Header & Trim Options

Treat row one as keys or generate col_1, col_2 names. Trim surrounding whitespace on every value so " Alex " becomes "Alex" without touching quoted spaces.

Copy or Download JSON

Output is pretty-printed with two-space indentation. Copy it to the clipboard or download a ready-to-use .json file in one click.

100% Client-Side

Parsing runs entirely in your browser. Your CSV — HR exports, financials, analytics dumps — never touches a server, and the tool works offline once loaded.

CSV to JSON Converter: turn spreadsheet rows into a JSON array of objects

Convert CSV rows into JSON objects with the available header and delimiter options. Inspect quoted fields and inferred types before using the output. CSV has no universal type system. A field that looks numeric may be a postal code or identifier with meaningful leading zeros. Keep such values as strings when required, and review blank fields, duplicate headers, embedded delimiters, and line breaks in quoted cells.

How to use the CSV to JSON converter

  1. Paste your CSV into the CSV Input box, or load the built-in sample to see the expected shape.
  2. Pick a delimiter — or leave it on Auto-detect to let the parser choose comma, semicolon, tab, or pipe.
  3. Keep Header Row on to key each object by column name; turn it off to get generic col_1, col_2 keys.
  4. Toggle Trim Values to strip surrounding whitespace, so " Alex " becomes "Alex".
  5. Toggle Infer Types to turn "123" → 123 and "true" → true; leave it off to keep every value a string.
  6. Read the live JSON Output, then Copy it or Download a .json file.

How CSV maps to JSON, and what the spec says

CSV is a flat, row-and-column text format defined by RFC 4180, which registers the text/csv MIME type. JSON is a hierarchical key-value format defined by RFC 8259 / ECMA-404. Converting CSV to JSON means turning each data row into one object: the header cells become the keys, and that row's cells become the values. The whole file becomes an array of those objects.

The escaping rules are where conversions break. RFC 4180 says any field containing a comma, double quote, or line break must be wrapped in double quotes, and a literal double quote inside that field is escaped by doubling it. This parser implements both rules exactly, so "Park, Min" stays one value and "She said ""hi""" decodes to She said "hi". A newline inside quotes stays part of the value instead of starting a new row.

"Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes."— RFC 4180, §2, rule 6

Need to go the other way, or compare formats first? Use the reverse JSON to CSV converter, the bidirectional CSV ↔ JSON converter, or read the deep dive in our how to convert CSV to JSON guide.

Worked examples: CSV → JSON

Basic row · header on · infer types on

id,name,active
1,Alex Rivera,true

→ [{ "id": 1, "name": "Alex Rivera", "active": true }]

Comma inside a quoted field

id,name
3,"Sara Khan, US"

→ [{ "id": 3, "name": "Sara Khan, US" }] — one value, not two

Newline inside a quoted cell

id,note
5,"line one
line two"

→ [{ "id": 5, "note": "line one\\nline two" }] — still one row

Edge case · leading-zero ID & big integer

With infer types on, 01730 is kept as the string "01730" (a coerced number would drop the leading zero), and a 19-digit ID like 1234567890123456789 also stays a string because it exceeds Number.isSafeInteger (253-1 = 9007199254740991). Snowflake IDs, ZIP codes, and phone numbers survive intact. Turn infer types off to guarantee strings for every field.

Type inference reference

With Infer Types enabled, this is exactly how each CSV string is coerced. Anything not matching a rule below stays a string verbatim.

CSV valueJSON outputRule
123123Safe integer (≤ 253-1)
3.143.14Decimal number
true / True / TRUEtrueBoolean (3 casings)
null / NULL / (empty)nullNull or empty cell
01730"01730"Leading zero → stays string
1234567890123456789"1234567890123456789"Exceeds safe integer → string

Three behaviors most CSV-to-JSON converters get wrong

1. Empty trailing cells become empty strings, not dropped keys. If a row is shorter than the header — say 5,"Dana Lopez",intern, with a missing joined — that key is still emitted, as ""(or null with infer types on). Every object keeps the same shape, so downstream code never hits an undefined key.

2. A quote mid-field is treated literally. RFC 4180 only gives a double quote special meaning at the start of a field. So 5" pipe in a cell is read as the literal text 5" pipe, not a malformed quoted field — matching how Excel handles stray quotes, so your data round-trips instead of erroring.

3. Auto-detect ignores quoted delimiters. When counting candidate delimiters in the first row, this parser skips any that sit inside quotes. A header like name,"city;region",age is correctly read as comma-delimited, not semicolon-delimited — the ; inside the quoted cell does not fool the detector.

Last updated: September 15, 2026 · Runs 100% in your browser — no uploads, tool input is not sent to Toolk.

Frequently asked questions

What keys do objects get when my file has no header row?

Turn the Header Row toggle off and each object is keyed generically as col_1, col_2, col_3 in column order. With it on — the default — the first row supplies the property names for every object beneath it.

How does delimiter auto-detection decide between comma and semicolon?

It scans the first logical line — quote-aware, so an embedded newline cannot end the sample early — counts each candidate outside quoted regions, and keeps the most frequent, falling back to comma on ties. Comma, semicolon, tab, and pipe are covered; you can always override the choice manually.

Why did a multi-line cell not break my row count?

A newline inside a double-quoted field is part of the value per RFC 4180, so a note spanning two lines stays one cell and one JSON string rather than starting a new object. Only unquoted line breaks separate rows.

Is the CSV I paste uploaded anywhere?

No. Parsing happens locally in your browser, and Toolk's page analytics do not receive your CSV content or the generated JSON. Tool input is not sent to Toolk, which matters for customer or financial exports.

Where do I go to turn JSON back into CSV?

Use the JSON to CSV converter at /tools/json-to-csv for the reverse direction, or the bidirectional CSV ↔ JSON converter when you need both directions plus delimiter control in a single tool.

Need a different tool?

Browse all 103 browser-based tools (103 currently marked free), or tell us what useful utility we should build next.

Browse all tools