This CSV to JSON converter turns spreadsheet exports into a JSON array of objects, and turns JSON back into CSV. It handles quoted fields, commas and line breaks inside quotes, and doubled quotes, following RFC 4180. Conversion runs in your browser, so customer lists and financial exports are never uploaded.
How to use the CSV to JSON converter
- Choose CSV → JSON or JSON → CSV. Switching direction carries the current result over as the new input.
- Pick a Delimiter: Comma, Semicolon, Tab, Pipe, or Auto-detect.
- For CSV input, keep First row is header ticked to get objects keyed by column name. Untick it to get an array of arrays.
- Paste your data. The output updates as you type, and errors name the line or row to fix.
- Click Copy, or Download .json / Download .csv to save a file.
How it works
The CSV parser reads one character at a time. Outside quotes, the delimiter ends a field and a line break ends a row. Inside a quoted field, delimiters and line breaks are kept as text, and "" stands for one quote character. Both Windows (CRLF) and Unix (LF) line endings work, a leading byte-order mark is removed, and blank lines are skipped. Auto-detect counts commas, semicolons, tabs and pipes on the first line, ignoring quoted text, and uses the most common one.
With a header row, each later row becomes an object. Empty header cells are named column1, column2 and so on, and repeated names get _2 added. A row with more fields than the header is reported as an error, because that usually means the wrong delimiter. All values stay as strings, so ZIP codes like 02134 keep their leading zero.
For JSON to CSV, the input must be an array of objects (a single object also works). The header is the union of all keys in first-seen order, missing values become empty cells, and nested objects or arrays are written as JSON text. Fields containing the delimiter, a quote, a line break or leading or trailing spaces are quoted.
Example
This CSV has a quoted comma, escaped quotes, a line break inside quotes and an empty last field:
name,city,note
Ana Silva,Lisbon,"Likes ""quotes"", commas"
Raj Patel,Pune,"Two
lines"
Mei Chen,Taipei,
Converted to JSON:
[
{ "name": "Ana Silva", "city": "Lisbon", "note": "Likes "quotes", commas" },
{ "name": "Raj Patel", "city": "Pune", "note": "Twonlines" },
{ "name": "Mei Chen", "city": "Taipei", "note": "" }
]
The tool indents each key on its own line; the objects are shown compactly here to save space. Converting that JSON back gives the original CSV exactly. JSON with different keys per item, [{"a":1},{"b":[1,2],"a":null}], becomes:
a,b
1,
,"[1,2]"
Common errors and fixes
| Message mentions | Likely cause |
|---|---|
| Quote in the middle of an unquoted field | A value like 5" screen; quote the field and double the quote |
| Text after a closing quote | An inner quote that was not doubled |
| Quoted field never closed | A missing closing quote, often from a cut-off export |
| Row has more fields than the header | Wrong delimiter, or a comma that should be quoted |
| Item is not an object | JSON array of plain values instead of objects |
To tidy or validate the JSON afterwards, use the JSON formatter.
Frequently asked questions
Why are numbers in quotes in the JSON?
CSV has no data types, so every value is kept as text. This protects leading zeros and long IDs. Convert specific fields to numbers in your code if needed.
My European CSV uses semicolons. Will it work?
Yes. Auto-detect picks semicolons, or choose Semicolon from the Delimiter list.
Can I convert an Excel file?
Save it as CSV from Excel first, then paste the text here.
What happens to nested JSON when converting to CSV?
Nested objects and arrays are written as JSON text in a single cell, since CSV is flat.
Is my data uploaded?
No. Parsing happens in your browser, and downloads are created on your device.
