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
- 1Paste a CSV table into the input panel on the left.
- 2The JSON array appears in the output panel on the right as you type.
- 3Click Copy in the output header to copy the JSON.
- 4Click Download to save the result as a
.jsonfile. - 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 F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run 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.
name,email,role Alice,[email protected],admin Bob,[email protected],user
[
{ "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?
"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?
Why are all my numbers strings in the JSON output?
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.