How to convert CSV to JSON
- Paste your CSV into the top box. Copying cells straight from Excel or Google Sheets produces tab-separated text, so choose Tab as the delimiter in that case.
- Select the delimiter (comma, semicolon or tab) and decide whether the first row contains column names.
- Click Convert. A green message reports the row and column count, which is a quick check that nothing was lost.
- Click Copy JSON or Download .json, which saves a file named
converted.json.
A worked example
Given this input with headers on:
name,age,city
Alice,30,"New York, NY"
Bob,25,Boston
the output is an array of two objects: {"name":"Alice","age":"30","city":"New York, NY"} and the matching one for Bob, pretty-printed with 2-space indentation. Notice that the comma inside the quotes stayed part of the city, and that age is the text "30", not the number 30. With headers off, you get an array of arrays instead, with the header row included as the first entry.
Everything comes out as text
The converter does not guess types. Numbers, dates, true, false and empty cells are all kept as strings, and an empty cell becomes "" rather than null. That is deliberate: guessing would corrupt values such as ZIP codes (02134), phone numbers, product codes like 1E5 and long IDs that would lose digits as numbers. If your code needs numbers, convert the specific fields after import, for example with Number(row.age) in JavaScript or int() in Python.
How the parser treats awkward input
- Quoted fields may contain the delimiter, line breaks and doubled quotes:
"She said ""hi"""becomesShe said "hi". - Unclosed quote: the converter stops with an error that gives the line where the input ended, instead of silently producing wrong JSON.
- Text after a closing quote (for example
"abc"def) is reported as an error with the line number. - Blank lines, including a trailing newline at the end of the file, are skipped.
- Short rows are padded with empty strings. Long rows keep their extra cells under generated keys
field3,field4and so on, so no data is dropped. - Empty header cells are renamed
field1,field2by column position. - Duplicate headers collide: if two columns are both named
id, the later one overwrites the earlier one. Rename them before converting. - Whitespace around values is kept exactly as typed, so
Alice, 30yields" 30"with a leading space. Remove stray spaces in the source if that matters.
Choosing the right delimiter
Comma is the default in US and UK exports. Many European locales use a comma as the decimal separator (3,14), so their spreadsheet software exports with semicolons. If the whole row lands in a single column, you have probably picked the wrong delimiter. A quick tell: if the first line has no commas but several semicolons, switch the setting. Tab-separated text, also called TSV, is what you get when you copy a range from a spreadsheet.
Objects or arrays, and when to use each
Use objects (headers on) when the data feeds an API, a front-end component or a NoSQL import, because each field is named. Use arrays (headers off) when columns have no meaningful names, when you need to preserve the exact grid, or when you want to process the header row yourself.
Is it private and safe?
Yes. The parsing and JSON generation happen in your browser, and nothing is sent to a server. That makes it appropriate for customer lists and financial exports, though the file you download lands on your device, so handle it as you would the original CSV.
Related guides: How to convert CSV to JSON and How to convert JSON to CSV for Excel. Use the JSON Formatter to validate or minify the result.
Frequently asked questions
How do I convert CSV to JSON?
Paste your CSV into the input box, choose the delimiter your file uses, decide whether the first row holds headers, and click Convert. You can then copy the JSON or download it as a .json file.
Does it handle commas and line breaks inside values?
Yes. Values wrapped in double quotes can contain the delimiter, line breaks and escaped quotes written as two double quote characters. An unclosed quote produces a clear error with a line number.
Why are my numbers in quotes in the JSON?
Every value is kept as text on purpose, so ZIP codes with leading zeros, long IDs and codes like 1E5 are never altered. Convert specific fields to numbers in your own code after importing.
Why is everything in one column?
The delimiter setting does not match your file. European exports often use semicolons, and text copied from a spreadsheet is tab-separated. Try the other options and check the column count in the green message.
What happens if rows have different numbers of columns?
Short rows are padded with empty strings, and extra cells in long rows are kept under keys like field4. Nothing is discarded, so you can spot ragged rows by looking for those generated keys.
Can I convert an Excel .xlsx file?
Not directly. Open the workbook, copy the cells and paste them in with the Tab delimiter, or use Save As CSV first. Only the sheet you copy is converted.
Is my CSV uploaded?
No. The conversion runs entirely in your browser, and your data is never uploaded or stored.
Is it free?
Yes. It is completely free, with no sign-up and no limits.