About CSV to JSON
CSV looks simple until a real export arrives: a customer name with a comma in it, an address that runs over two lines, a German file that uses semicolons, a byte order mark stuck to the first column name. This converter reads all of that and gives you a JSON array with one object per row, keyed by the header.
It suits anyone moving data out of a spreadsheet or database dump and into code: seeding a test database, feeding an API, or loading a list into a front end. Whatever you paste stays on your device, which matters when the file is a customer list.
You end up with JSON you can copy or download, plus a table of the rows as they were read, so you can see at a glance whether the columns lined up before you trust the output.
How it works
The reader follows RFC 4180. A double quote opens a quoted cell only at the very start of a cell, so a value such as 5" disk stays as written, while "Doe, Jane" is one cell and "" inside quotes is a literal quote. Line breaks inside quotes stay in the value. An unclosed quote stops with an error naming the line, because guessing would pull the rest of the file into one cell.
With Detect selected, the delimiter comes from the first 25 records, counted outside quotes: comma, semicolon, tab or pipe, whichever splits them most consistently. If every comma sits between digits and semicolons split evenly, the file is treated as European style, where 1,5;2,5 is two decimal numbers. A first line of sep=;, a hint Excel understands, is honored and removed.
Type detection works per column. A column converts only if every value in it does, so one 02134 keeps a postcode column as text and its other values do not silently become numbers. Numbers too long to store exactly are also left as text, with all their digits.
How to use CSV to JSON
- Paste CSV into the left box, or use Open file for a
.csv. Try an example loads a small one. - Check Rows as read under the result to confirm each value landed in the right column.
- Open Options if you want typed values, nested objects, or a fixed delimiter.
- Use Copy or Download .json.
A quoted comma and a postcode with a leading zero
id,name,zip,active
1,"Lovelace, Ada",02134,true
2,Grace Hopper,10001,false[
{
"id": 1,
"name": "Lovelace, Ada",
"zip": "02134",
"active": true
},
{
"id": 2,
"name": "Grace Hopper",
"zip": "10001",
"active": false
}
]This run has Detect numbers, booleans and null turned on. id and active became real values, but zip stayed text in both rows because 02134 cannot become a number without losing its zero.
When it helps
- Turning a CRM or newsletter export into fixtures for a test suite.
- Loading a small lookup table, such as country codes, into a front end without a database.
- Checking what a messy third-party CSV really contains, since uneven rows are listed by line number.
- Reshaping an export with headers such as
user.nameanduser.emailinto nested objects for an API.
Tips for a better result
- Leave type detection off if the values will be matched as text later. IDs and phone numbers are safer as strings.
- If the row table shows everything in one column, the delimiter guess was wrong. Choose it by hand in Options.
- Duplicate headers are numbered (
name,name_2) so no values are lost. Rename them in the file if you want tidier keys.
Good to know
- Files over 10 MB are refused, because conversion happens in your browser tab.
- JSON objects do not keep integer-like keys in place, so a header such as
2024moves ahead of text headers in each object. - Line breaks inside quoted cells are normalized to a single newline character.
- All type detection is by pattern. Dates stay as text, because a CSV does not say what format a date is in.
Questions people ask
Why are all my numbers in quotes?
CSV has no types, so every cell is text until told otherwise. Turn on Detect numbers, booleans and null under Options. A column that holds even one non-numeric value stays as text, which keeps the column consistent.
What happens to rows with too many or too few cells?
Nothing is thrown away. Short rows get empty values, and extra cells go into a new column such as column_4. A notice above the options names the first affected line so you can look at it.
My file opens with strange characters at the start of the first header. Can this handle it?
Those characters are a UTF-8 byte order mark, and it is removed before parsing. UTF-16 files, which Excel can save as Unicode text, are recognized from their byte order mark as well.
Can I get nested JSON from a flat CSV?
Yes, if your headers use dots. Turn on Nest dotted headers and user.name becomes a name key inside a user object. Two headers that conflict, such as user and user.name, produce an error instead of losing one.
What to use next
- JSON Formatter: to reindent or sort the keys of the JSON you just made
- CSV to SQL Inserts: if the rows are going straight into a database
- JSON to CSV: for the return trip after editing the data
Learn more
Last reviewed . Read our editorial policy.