What Does This CSV to JSON Converter Do?
CSV (comma-separated values) is how spreadsheets, databases and many exports share tabular data. JSON is what most APIs, JavaScript code and configuration files expect. This tool turns one into the other: each CSV row becomes a JSON object, with the column names from the first row as keys.
Everything runs in your browser. The CSV you paste is not uploaded to a server, so it is fine to use with internal exports and test data.
How to Convert CSV to JSON
- 1
Paste your CSV
Paste it into the CSV input box, straight from Excel, Google Sheets, a database export or a.csvfile opened in a text editor. - 2
Check the options
The delimiter is detected automatically (comma, semicolon, tab or pipe). Untick First row is header if your data has no column names, and you'll get an array of arrays instead of objects. - 3
Click "Convert to JSON"
The JSON appears on the right, with a count of rows and columns underneath so you can check nothing was missed. - 4
Copy or download
Use Copy to paste it into your code, or Download .json to save it as a file.
Example
id,name,city,active 1,"Smith, Jane",Austin,true 2,Bob,,false 3,Chloé,Pune,true
[
{ "id": 1, "name": "Smith, Jane", "city": "Austin", "active": true },
{ "id": 2, "name": "Bob", "city": "", "active": false },
{ "id": 3, "name": "Chloé", "city": "Pune", "active": true }
]The comma inside "Smith, Jane" stays part of the name because the field is quoted.
How Values Are Converted
With Detect numbers & true/false switched on, a value only becomes a number, boolean or null when that can't change what it means. Everything else stays a string:
- ✓
42and-3.5become numbers. - ✓
true,false(orTRUE/FALSEfrom Excel) become booleans, andnullbecomes null. - ✓
00123stays the string"00123", so ZIP codes, phone numbers and IDs keep their leading zeros. - ✓Long IDs such as
12345678901234567890stay strings, because JavaScript numbers can't hold that many digits exactly. - ✓
1.50and1e3stay strings, so the original formatting is preserved. - ✓Empty cells become empty strings
"". - ✓Types are decided per column, so a column never mixes strings and numbers. If one ZIP code is
00123, every ZIP code in that column stays a string.
Switch the option off to keep every value as a string.