CSV to JSON Converter
Convert CSV data with headers into a JSON array.
Was this tool helpful?
Thanks for the feedback!
This CSV to JSON Converter turns a comma-separated table into a JSON array with one object per row, using the first line as the property names. It suits developers moving spreadsheet exports into an API, a seed file or a JavaScript app, and anyone who needs data from Excel or Google Sheets in JSON form.
Example conversion
Input:
name,city,amount
Priya,Pune,1500
"Rao, K.","New Delhi","2,40,000"
Output:
[
{
"name": "Priya",
"city": "Pune",
"amount": "1500"
},
{
"name": "Rao, K.",
"city": "New Delhi",
"amount": "2,40,000"
}
]
The second data row shows why quoting matters: the name and the Indian-format amount both contain commas, so they must be wrapped in double quotes in the CSV, or they would be split into extra columns.
How the parser handles tricky rows
- Quoted fields may contain commas and even line breaks, and a doubled quote (
"") inside quotes becomes one literal", following the usual CSV convention described in RFC 4180. - Windows and Unix line endings both work, and completely blank lines are skipped.
- Short rows get an empty string for missing cells; long rows lose any cells beyond the last header.
- Everything stays text. Numbers, TRUE/FALSE and empty cells all become strings, so
1500arrives as"1500". That avoids guessing wrongly about employee IDs, ZIP codes or phone numbers with leading zeros, but you may want to convert numeric fields in your code, for example withNumber(row.amount). - Headers are used exactly as written, spaces included. A header of " City" produces the key
" City", and if two columns share a name, the later one overwrites the earlier.
Getting a clean CSV out of a spreadsheet
In Excel, use File → Save As → CSV UTF-8 (Comma delimited) so that names in Hindi or other scripts and symbols like ₹ survive. In Google Sheets, choose File → Download → Comma-separated values. Some regional Excel settings save CSV with semicolons instead of commas; the converter then sees a single column, and you'll get objects with one long key like "id;name". Change the delimiter or re-export with commas. Tab-separated data copied straight from a sheet belongs in the TSV to JSON Converter, and an .xlsx file can go through the Excel to JSON Converter.
Requirements and limits
The input needs a header row plus at least one data row; otherwise the tool asks for them. Only the comma is recognised as a separator, and the output is always an array of flat objects, pretty-printed with two-space indentation. Nested JSON can't be expressed in plain CSV, so if you need objects inside objects, restructure the result in code. Conversion happens in your browser. To go back the other way, use the JSON to CSV Converter.