CSV to JSON
Convert CSV with a header row into a tidy JSON array of objects.
How to use the CSV to JSON
- Paste CSV with a header row on top.
- Each row becomes a JSON object keyed by the headers.
- Copy the formatted JSON output.
About the CSV to JSON
CSV looks trivial and is not. There is no single CSV standard — RFC 4180 is the closest thing to a common reference, and plenty of software ignores parts of it. A field containing a comma must be wrapped in double quotes; a quote inside a quoted field is escaped by doubling it; and a quoted field may contain line breaks, which is why splitting a CSV on newlines is a bug waiting to happen. This tool uses a real character-by-character parser, so all three cases come through intact, and Windows CRLF line endings are normalised.
The first row is treated as the header and supplies the keys; every row after it becomes one object in a formatted JSON array. Blank lines are skipped. Every value stays a string — no type guessing — which is deliberate: it keeps leading-zero IDs, phone numbers and postcodes from being quietly mangled into numbers.
The honest limits. The delimiter is a comma, so semicolon or tab-separated exports need converting first. There is no BOM stripping, so a UTF-8 byte-order mark saved by Excel ends up glued to the first key. Rows with more fields than headers lose the extras; rows with fewer get empty strings; duplicate headers overwrite each other. It runs entirely in your browser, so a customer export is never uploaded. Going the other way, use JSON to CSV; to shrink the result, the JSON minifier.
Frequently asked questions
Does the first row have to be a header?
Yes. The first line always supplies the object keys, and each following line becomes one object. If your file has no header row, add one first — otherwise your first record is consumed as the key names.
Does it handle commas and line breaks inside a field?
Yes, as long as the field is wrapped in double quotes. The parser tracks quoted state character by character, so commas, newlines and doubled quotes ("") inside a quoted field are all preserved rather than splitting the row.
Why are my numbers strings in the output?
By design. Guessing types corrupts real data — leading-zero IDs lose their zeros, long numbers lose precision, and values like 1-2 or dates get misread. Everything stays a string; cast the fields you actually need in your own code.
Can it handle semicolon or tab-separated files?
No. The delimiter is a comma, full stop. If your export uses semicolons — common when Excel runs in a European locale — re-export it as comma-separated, or replace the delimiters before pasting.
My first key has strange characters in front of it. Why?
That is a UTF-8 byte-order mark, which Excel writes at the start of the file. It is not stripped here, so it becomes part of the first header name. Delete the invisible leading character before pasting, or save the file without a BOM.

