About the CSV to JSON
CSV is how spreadsheets, databases and reporting tools export data. JSON is what web apps, APIs and JavaScript code expect. The CSV to JSON converter turns one into the other: paste a CSV export or open a .csv file, and each row becomes a JSON object with the column headers as keys.
It reads real-world CSV correctly. Quoted fields with commas or line breaks inside them, doubled quotes, semicolon-separated files from European versions of Excel, tab-separated data and files with a byte order mark all work. The delimiter is detected for you, and numbers, true, false and null become real JSON values instead of text.
You can choose the shape of the result: a list of objects, a list of arrays, one array per column, or an object keyed by the first column. Column names with dots can become nested objects. The conversion runs in your browser, so your data never leaves your device.
How to use it
- Add your CSVPaste it into the CSV box, drop a .csv, .tsv or .txt file onto it, or use Open. Sample loads a small contact list.
- Check the delimiterDetect automatically works for most files. If the columns look wrong, choose comma, semicolon, tab or pipe yourself.
- Pick the output shapeArray of objects is the most common. You can also choose Array of arrays, Object of columns or Object keyed by first column.
- Set the optionsDecide whether the first row is the header, whether to detect numbers and true/false, whether to trim spaces and whether to nest keys with dots.
- Copy or downloadThe status line shows how many rows and columns were read. Copy the JSON or download it as data.json.
Key features
Proper CSV parsing
Follows the usual CSV rules: quoted fields can contain commas, line breaks and quotes written as two quotes ("").
Delimiter detection
Looks at the first 20 lines and picks the comma, semicolon, tab or pipe that splits them most consistently.
Real JSON types
Numbers, true, false and null become JSON values. Values that would lose information, like 02134 or very long IDs, stay as text.
Four output shapes
Objects for APIs, arrays for compact data, columns for charts, or an object keyed by ID for quick lookups.
Nested keys
With nesting on, a column called address.city becomes "address": {"city": ...}.
Private by design
Your file is read and converted in your browser. Nothing is uploaded.
Examples
Converting a contact list
The Sample button loads this CSV:
id,name,email,age,active,address.city
1,Ana Silva,ana@example.com,34,true,Lisbon
2,"Okafor, Mia",mia@example.com,28,false,Lagos
3,Lee Chen,,41,true,"New York"
The status line reads 3 rows × 6 columns, comma separated. The first object looks like this:
{
"id": 1,
"name": "Ana Silva",
"email": "ana@example.com",
"age": 34,
"active": true,
"address.city": "Lisbon"
}
"Okafor, Mia" keeps its comma because it is quoted, and Lee Chen's empty email becomes an empty string. Turn on nesting and the last key becomes "address": {"city": "Lisbon"}.
The four output shapes
Here is the same sample, minified, in each shape (only the start is shown):
Array of objects (292 bytes):
[{"id":1,"name":"Ana Silva","email":"ana@example.com",...},...]
Array of arrays (194 bytes), with the header as the first array:
[["id","name","email","age","active","address.city"],[1,"Ana Silva",...],...]
Object of columns (198 bytes):
{"id":[1,2,3],"name":["Ana Silva","Okafor, Mia","Lee Chen"],...}
Object keyed by first column (304 bytes):
{"1":{"id":1,"name":"Ana Silva",...},"2":{...},"3":{...}}
How values are typed
| CSV value | JSON value |
|---|---|
| 7 | 7 |
| 19.90 | 19.9 |
| 1e3 | 1000 |
| null | null |
| 02134 | "02134" |
| TRUE | "TRUE" |
| (empty) | "" |
ZIP codes with a leading zero stay as text, and so do integers too long to store exactly, such as 12345678901234567890, so nothing is lost. Only lowercase true, false and null are converted.
Semicolon files from Excel
In many countries, Excel saves CSV with semicolons and decimal commas:
name;price
Tea;1,50
Coffee;2,25
The converter detects the semicolon and reads 2 rows × 2 columns. The prices stay as text, "1,50" and "2,25", because a comma is not a decimal point in JSON.
Tips
- Export from Excel or Google Sheets as "CSV UTF-8" so accented letters and symbols come through correctly.
- Turn off "Detect numbers, true/false and null" when every value must stay text, for example product codes, phone numbers or IDs that a system expects as strings.
- Name your columns with dots, such as address.street and address.city, and turn on nesting to get grouped objects without editing the JSON by hand.
- Use Object keyed by first column when your first column holds unique IDs. Your code can then look up a record with data["42"] instead of searching a list.
- If the status line says some rows have a different number of fields, look for an unquoted comma inside a value or a missing column in those rows.
Common mistakes and limits
- Unquoted commas inside valuesA value like Smith, John needs quotes around it in CSV ("Smith, John"). Without them it is read as two fields and the columns shift.
- Losing extra fieldsWhen a row has more fields than the header, the extra fields are left out of the objects. The status line warns you when rows do not match the header.
- Duplicate IDs with the keyed shapeObject keyed by first column keeps only the last row for each key. If two rows share an ID, the first one is replaced without a warning.
- Expecting decimal commas to become numbersJSON numbers use a period, so 1,50 stays the text "1,50". Change the decimal separator in your spreadsheet before exporting if you need numbers.
- Forgetting the header settingIf your file has no header row, turn off "First row is the header". Otherwise the first data row is used as the keys and goes missing from the results.