About the CSV to JSON Converter
This CSV to JSON converter turns pasted spreadsheet data into JSON you can use in code, APIs, fixtures and config files. By default each row becomes an object keyed by the header row; switch to arrays of arrays for compact output. The parser follows RFC 4180, so quoted fields containing commas, line breaks and doubled quotes ("") are handled correctly.
It is for developers importing exports from Excel, Google Sheets or a database, analysts preparing data for a chart library, and anyone who needs a quick, private conversion — everything runs in your browser and nothing is uploaded. The delimiter is detected automatically, which matters for European exports that use semicolons and for tab-separated data copied straight from a spreadsheet.
With type conversion on, plain numbers become JSON numbers, true/false become booleans and empty cells become null. Values with leading zeros (ZIP codes, phone numbers, IDs such as 007) and decimal commas like 2,50 stay as strings so no information is lost.
How to use the csv to json converter
- 1Paste your CSV (or copy cells straight from Excel or Google Sheets).
- 2Leave the delimiter on auto-detect or pick one.
- 3Choose whether the first row is a header and whether to convert types.
- 4Pick array of objects or array of arrays, and the indentation.
- 5Copy the JSON output.
Formula and method
The text is read character by character following RFC 4180: a field that starts with a double quote continues until the closing quote, so delimiters and line breaks inside quotes are kept, and a doubled quote ("") becomes one quote character. Rows end at LF or CRLF line breaks.
The first row supplies the keys (blank headers become column1, column2…, duplicates get _2, _3). With type conversion, a cell is turned into a number only when it is a plain decimal without leading zeros, true/false become booleans and empty cells become null; everything else stays a string.
- delimiter
- Field separator — comma, semicolon, tab or pipe (auto-detected from the first line)
- header
- First row used as object keys
Worked examples
Contacts with quoted commas
The header row gives four keys. "New York, NY" and "Chen, Wei" are quoted, so their commas stay inside the value. Ages become numbers, true/false become booleans and Chen’s empty city becomes null.
European semicolon export, minified
Auto-detect finds two semicolons and no commas outside values in the first line, so ; is the delimiter. 2,50 uses a decimal comma and 007/012 have leading zeros, so they stay strings; 3 becomes a number.
No header, arrays of arrays
With the header option off every line is data, and array output gives one inner array per row: [[1,2,3],[4,5,6]].
Frequently asked questions
How do I convert CSV to JSON?+
Paste the CSV into the box above. Each row becomes a JSON object whose keys come from the header row, and you can copy the result. For code, most languages have a CSV library plus a JSON serializer that do the same.
How are commas inside values handled?+
Fields wrapped in double quotes can contain commas, semicolons and even line breaks. A literal quote inside a quoted field is written as two quotes (""), as defined in RFC 4180.
Why are some numbers kept as strings?+
Numbers with leading zeros (ZIP codes, IDs), decimal commas (2,50) and values too large for exact JSON numbers are kept as text so nothing is silently changed. Turn off type conversion to keep every value as a string.
Can I convert Excel files?+
Copy the cells in Excel or Google Sheets and paste them here — they arrive tab-separated and auto-detect handles them. Or save the sheet as CSV UTF-8 and paste the file contents.
Is my data uploaded anywhere?+
No. The conversion runs entirely in your browser with JavaScript; the CSV is never sent to a server, so it is safe for private or confidential data.