CSV to JSON Converter
Auto-detect delimiter and headers, optionally infer numbers and booleans, output as array of objects or array of arrays. RFC 4180-compliant — handles quoted fields, embedded commas, escaped quotes. 100% client-side.
What is the CSV to JSON Converter?
CSV to JSON Converter is a from-scratch RFC 4180 CSV parser plus a JSON emitter. It auto-detects the most common delimiter (comma, semicolon, tab or pipe) by sniffing the first ten lines — or you can pick one manually. Quoted fields containing the delimiter, escaped double quotes (`""`), CRLF or LF line endings are all handled correctly. With 'header row' on (default), the first non-empty row becomes the field names; without it, columns are named `field1`, `field2`, etc. The 'typed values' option auto-converts numbers (integers + floats), booleans (`true` / `false` / `TRUE` / `FALSE`) and `null` / `NULL`; turn it off to keep every cell as a string. Output is either an array of objects (the API-response shape — recommended) or an array of arrays (preserves column order without rebuilding headers). Field-count consistency is reported per row, so malformed CSV (unescaped delimiter inside a field) is flagged. Pure functions, no upload.
How to use it
- Paste your CSV — comma, tab, semicolon or pipe-delimited.
- Pick the delimiter manually or let the auto-detector sniff it.
- Choose 'array of objects' (header → field name) or 'array of arrays' (column order).
- Copy the JSON or download as .json.
Benefits
- Auto-detects comma, semicolon, tab and pipe delimiters by sniffing the first 10 lines.
- RFC 4180-compliant — quoted fields with embedded delimiters and `""`-escaped quotes both work.
- Handles CRLF (Windows / Excel) and LF (Unix) line endings.
- Optional type coercion for numbers, booleans and `null`.
- Two output shapes: array of objects (API-shape) or array of arrays (column-order preserving).
- Header row detection plus auto-naming (`field1`, `field2`) when absent.
- Field-count consistency check — flags rows that don't match for fast debugging.
- Runs 100% in your browser — Toollyz has no server.
Frequently asked questions
Does it handle quoted fields with embedded commas?
Yes — RFC 4180 quoting is fully supported. A field like `"Smith, John"` is parsed as the single value `Smith, John`.
How does it escape double quotes inside a field?
Per RFC 4180, two consecutive double quotes (`""`) inside a quoted field decode to a single `"`. So `"He said ""hi"""` parses as `He said "hi"`.
Will it handle Windows line endings (CRLF)?
Yes — both CRLF and LF are recognised as row terminators. The parser doesn't care which you use.
What's the difference between 'array of objects' and 'array of arrays'?
Array of objects: `[{ id: 1, name: 'Ada' }, … ]` — each row is a JSON object keyed by the header. Array of arrays: `[[1, 'Ada'], … ]` — each row is a JSON array, preserving column order without naming fields. Pick the first for API responses, the second when column order matters more than field names.
How does delimiter auto-detection work?
We count occurrences of comma, semicolon, tab and pipe in the first 10 lines and pick whichever appears most. Override manually if your data is unusual.
What types are detected?
Integers (`-?\d+`), decimals (`-?\d+\.\d+`, optional scientific), booleans (`true` / `false` / `TRUE` / `FALSE`) and `null` / `NULL`. Everything else stays a string. Turn the toggle off if you want strict strings.
Why is my row showing extra fields?
Probably an unescaped delimiter inside one of your fields. The 'inconsistent field counts' warning is a hint — find the row, wrap the offending field in double quotes.
What if the header has duplicate names?
We keep them; the JSON object will have the second occurrence overwrite the first (JavaScript object semantics). Use 'array of arrays' if duplicates matter.
Can I convert in the other direction?
Yes — see JSON to CSV Converter (the companion tool).
How large a CSV can it parse?
Comfortable up to ~10 MB / 100 000 rows in modern browsers. The parser is O(n); the bottleneck is browser memory.
Is anything uploaded?
No. Parsing and JSON conversion run entirely in your browser.