About the CSV to JSON converter
CSV is how spreadsheets, databases and many services export data, but JavaScript code, APIs and NoSQL databases work with JSON. A CSV to JSON converter turns each row into an object, using the header row for the keys.
This converter follows the CSV standard (RFC 4180), so quoted values, commas and line breaks inside a value, and doubled quotes all come through correctly. It also detects whether the file uses commas, semicolons, tabs or pipes.
How to use the CSV to JSON converter
- Paste your CSV into the editor, click Open file to load a .csv file, or click Load sample.
- Leave the delimiter on Detect automatically, or choose one.
- Choose whether the first row is a header and whether to detect numbers, true/false and null.
- Click Convert to JSON, then Copy result or Download .json.
Example
Spreadsheet export to typed JSON
Input
id,name,price,in_stock,dimensions.width
1,"Desk, oak",249.99,true,120
2,Chair,89,false,45Output
[
{
"id": 1,
"name": "Desk, oak",
"price": 249.99,
"in_stock": true,
"dimensions": {
"width": 120
}
},
{
"id": 2,
"name": "Chair",
"price": 89,
"in_stock": false,
"dimensions": {
"width": 45
}
}
]Numbers and true/false become JSON types, the quoted comma stays inside the value, and the dotted header becomes a nested object.
Common errors and how to fix them
A quoted value starting on line 2 is never closed. Check for a missing " character.
A value opens a quote but never closes it, often because a field contains a stray ". Inside a quoted value, write a literal quote as two quotes: "".
Everything ends up in one field
The file uses semicolons or tabs. Leave the delimiter on Auto detect, or pick the right one; European Excel exports usually use ;.
Leading zeros disappear from codes like 00123
Number conversion turns 00123 into 123. Turn off type conversion so every value stays a string, which is what you want for ZIP codes, phone numbers and IDs.
Good to know
- With a header row, each row becomes an object such as
{"id": 1, "name": "Jamie"}. Without one, each row becomes an array of values. - Detecting types turns
42and3.5into numbers,true/falseinto booleans, and empty cells andnullintonull. Values with leading zeros, such as007or zip codes, and numbers too large for JavaScript stay as text so nothing is lost. - Cells that contain JSON arrays or objects, such as
["admin","editor"], are turned back into real arrays and objects. - Nest dotted columns turns a column like
address.cityinto{"address": {"city": …}}. That's the reverse of our JSON to CSV converter, so you can go back and forth. - Blank or repeated column names get unique keys like
column3orname_2, and blank lines are skipped.
Frequently asked questions
How do I convert an Excel file to JSON?
In Excel or Google Sheets, save or download the sheet as CSV, then open that file here with Open file. Each sheet needs to be exported separately.
Why are some numbers kept as strings?
Numbers with leading zeros, like 007, would lose the zeros as JSON numbers, and integers above 9,007,199,254,740,991 can't be stored exactly in JavaScript. They stay as strings so the value is unchanged.
My file uses semicolons. Will it work?
Yes. Detect automatically picks the delimiter that splits the rows into a consistent number of columns, which handles comma, semicolon, tab and pipe files. You can also choose the delimiter yourself.