Convert CSV to JSON

Paste any CSV table and get a JSON array of objects back. The CSV to JSON converter reads the first row as a header, maps every following row to an object keyed by those headers, and emits the result as a pretty-printed JSON array. Quoted fields, escaped quotes and embedded commas all parse correctly per RFC 4180. The transform runs in your browser; nothing uploads.

Input
Line 1:1 LF cloud_done Saved locally
Result CSV to JSON
0 lines 0 chars

CSV to JSON, plain and predictable

CSV to JSON conversion takes a comma-separated table and rewrites it as a JSON array of objects. The first non-empty row is treated as the header. Every subsequent row produces one JSON object, with the header cell as the key and the row cell as the value. Empty cells become empty strings rather than null, so you keep the rectangular shape of the source CSV. Field counts that do not match the header are reported in the output panel so you can spot a stray comma.

The parser follows RFC 4180. Fields wrapped in double quotes can contain commas, newlines and embedded double quotes (escaped as ""). Unquoted fields are read until the next comma or newline. Both \n and \r\n line endings are accepted, and the parser does not care which one your file uses. All values are emitted as JSON strings, since CSV has no native type system; cast them downstream if you need numbers or booleans.

If the CSV is malformed, the parser message is shown in the output panel. For the inverse direction, see JSON to CSV. If you want plain newline-separated values rather than a JSON array, see commas to newlines.

How to use convert csv to json

  1. 1Paste a CSV table into the input panel on the left.
  2. 2The JSON array appears in the output panel on the right as you type.
  3. 3Click Copy in the output header to copy the JSON.
  4. 4Click Download to save the result as a .json file.
  5. 5If a row has the wrong field count, fix the source row and the output refreshes.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

RFC 4180 quoted field handling

A field wrapped in double quotes can contain commas, newlines, and escaped double quotes written as "". Unquoted fields are read up to the next comma or line break. Leading and trailing whitespace inside an unquoted field is preserved as written.

Header row drives the JSON keys

The first non-empty row becomes the property name list. Duplicate headers are de-duplicated by appending _2, _3 and so on, so each output object keeps every column. Trailing whitespace in headers is preserved unless you trim before pasting.

Empty cells stay as empty strings

A blank field becomes "", not null, so the rectangular shape of the source CSV survives the round-trip. If you want true null for empty cells, run a downstream JSON transform such as a jq map.

Both line endings accepted

The parser reads \n and \r\n as row terminators interchangeably. A quoted field can span multiple lines without breaking the row. The output JSON always uses \n-only line endings inside the JSON literal.

Runs entirely in your browser

No upload, no server-side processing, no log of what you pasted. The parse and emit run on every keystroke. Tables up to a few megabytes convert in under a second on a desktop browser.

Worked example

First row becomes object keys, every following row becomes one object in the JSON array.

Input
name,email,role
Alice,[email protected],admin
Bob,[email protected],user
Output
[
  { "name": "Alice", "email": "[email protected]", "role": "admin" },
  { "name": "Bob", "email": "[email protected]", "role": "user" }
]

Settings reference

Behaviour Effect on output
Header row First non-empty row becomes the property name list.
Field separator Comma. Quoted fields can contain commas without splitting.
Quoting RFC 4180. Fields wrapped in "; embedded quotes escape as "".
Line endings \n and \r\n both accepted as row terminators.
Empty cells Emitted as empty string "", not null.
Duplicate headers De-duplicated with _2, _3 suffix on collision.
Type casting None. All values emit as JSON strings; cast downstream if you need numbers or booleans.
Mismatched row width Reported in the output panel with the offending row number.

FAQ

How are quoted fields parsed?
Per RFC 4180. Wrap a field in double quotes when it contains commas, newlines, or quote characters. To include a literal double quote, write it twice: "she said ""hi""" becomes the JSON string she said "hi". Unquoted fields end at the next comma or row break.
Can it handle a tab-separated file?
Not directly. This tool expects commas as the field separator. If you have a TSV file, run a find-and-replace to swap tab for comma first, or import the TSV into a spreadsheet and re-export as CSV.
Why are all my numbers strings in the JSON output?
CSV has no type system, so the safest behaviour is to emit every cell as a JSON string. Cast downstream with JSON.parse + a map, with jq, or with a spreadsheet formula. Casting at parse time would silently corrupt zip codes, phone numbers, and ID strings.
Is the CSV sent anywhere?
No. The parse and emit run entirely in your browser via JavaScript. Nothing is uploaded, nothing is logged, no record of your data exists on our servers.
What if a row has fewer columns than the header?
The output panel shows a warning with the row number. The object for that row still emits, with missing trailing keys set to empty string. Extra trailing columns beyond the header count are dropped, with a separate warning.