CSV to JSON Converter
Paste CSV, open a .csv file or paste cells from Excel to get a JSON array. The first row becomes the keys.
Convert CSV to JSON
APIs, JavaScript code and NoSQL databases want JSON; spreadsheets give you CSV. This converter turns each row into an object whose keys come from the header row, and handles the parts of CSV that trip up a quick split(","): quoted fields with commas, doubled quotes (""), line breaks inside a cell, and semicolon, tab or pipe separators, which are detected automatically.
Example
id,name,zip,salary,active
1,"Khan, Sara",05400,150000.50,true
2,Ali Raza,75500,98000,false[
{
"id": 1,
"name": "Khan, Sara",
"zip": "05400",
"salary": 150000.5,
"active": true
},
{
"id": 2,
"name": "Ali Raza",
"zip": "75500",
"salary": 98000,
"active": false
}
]How values are typed
With the typing option on, whole numbers and decimals become JSON numbers, true and false become booleans, and empty cells become null. A value is left as a string whenever turning it into a number would change it:
- Leading zeros (05400, 03001234567) and a leading + (+923001234567)
- Integers larger than 9,007,199,254,740,991, which JavaScript cannot store exactly (database IDs)
- Decimals with more digits than a double holds (3.14159265358979323846) and exponents (1e5)
The decision is made per column. In the example, 75500 stays "75500" because the same column holds 05400, so a zip code column never mixes strings and numbers. Turn typing off to keep every value exactly as text.
Headers
Blank header cells become column_1, column_2 and so on, and repeated names get a suffix (name, name_2), so no column is silently overwritten. Rows shorter than the header are padded with null. Untick "First row is header" for data without one, or choose "Array of arrays" to keep the rows as plain lists.
Frequently asked questions
- Can I paste directly from Excel or Google Sheets?
- Yes. Copied cells are tab-separated, and tabs are detected automatically, as are semicolons (common in European Excel exports) and pipes.
- Why is my number in quotes?
- Because converting it would change it: it has a leading zero or a plus sign, it is too large for JavaScript to store exactly, or another value in the same column has to stay text. This keeps zip codes, phone numbers and long IDs intact.
- How big a file can I convert?
- Files up to 25 MB can be opened. Everything runs in your browser, so very large files depend on your device's memory.
- Is my data uploaded?
- No. The conversion runs entirely in your browser.