CSV to JSON Converter

Paste CSV or spreadsheet data and get a JSON array of objects or arrays, with smart handling of quotes, numbers and empty cells.

Delimiter
Output
Values

🔒 Runs entirely in your browser. Nothing you enter is sent to a server.

CSV is how spreadsheets share data, and JSON is how web apps and APIs consume it. This converter bridges the two. Paste CSV, or cells copied straight from Excel or Google Sheets, and get well-formed JSON with proper numbers, booleans and nulls.

How to use the CSV to JSON converter

  1. Paste your CSV into the left box, or click Try an example.
  2. Leave the delimiter on Detect, or choose comma, semicolon, tab or pipe.
  3. Choose the output shape:
    • Array of objects uses the first row as keys, which is the most common format for APIs.
    • Array of arrays keeps every row, including the header, as a plain list.
  4. Choose whether to detect numbers and true/false or keep everything as text.
  5. Copy the JSON or download data.json.

How the conversion works

  1. Detect the delimiter. The first few lines are split by comma, semicolon, tab and pipe, and the one that gives the same number of columns on every line wins.
  2. Parse the text character by character following RFC 4180. Inside double quotes, delimiters and line breaks are part of the value, and "" stands for one quote character.
  3. Use the header row as keys, making repeated names unique.
  4. Convert values. A value becomes a number only if it looks exactly like one, with no leading zeros, and it fits in a safe integer range.
""            → null
"true"/"false" → true / false
"98.5"        → 98.5
"02134"       → "02134" (kept as text)
"Hopper, Grace" in quotes → "Hopper, Grace"

Worked example

This CSV has a quoted name containing a comma and an empty score:

id,name,city,score,active
1,Ada Lovelace,London,98.5,true
2,Alan Turing,Wilmslow,91,false
3,"Hopper, Grace",New York,,true

It converts to:

[
  { "id": 1, "name": "Ada Lovelace", "city": "London", "score": 98.5, "active": true },
  { "id": 2, "name": "Alan Turing", "city": "Wilmslow", "score": 91, "active": false },
  { "id": 3, "name": "Hopper, Grace", "city": "New York", "score": null, "active": true }
]
  • The delimiter is detected as comma.
  • "Hopper, Grace" stays in one field because it is quoted.
  • The empty score becomes null, and id, score and active become real numbers and booleans.

Common CSV problems

Problem Fix
Everything lands in one column Pick the right delimiter manually. Some European exports use semicolons.
“A quoted field is never closed” A value has an opening " without a closing one. Look for stray quote marks.
Accented letters look garbled The file was saved in a legacy encoding. Re-save it as UTF-8 and paste again.
Extra empty rows Blank lines are skipped automatically.
Numbers you want as text Choose “Keep everything as text”.

Tips

  • Clean headers first. Short, lowercase names without spaces, such as first_name, make the JSON easier to use in code.
  • Check the row count. The status line shows rows and columns, so you can confirm nothing was lost.
  • Keep IDs as text if they might have leading zeros or are longer than 15 digits.
  • Your data stays private. Everything is processed in your browser, and nothing is uploaded.

Frequently asked questions

How do I convert an Excel sheet to JSON?

Select the cells in Excel or Google Sheets, copy them and paste them here. Copied cells are tab-separated, and the converter detects that automatically. Or save the sheet as CSV and paste the file's contents.

How are numbers and true/false values handled?

With "Detect numbers & true/false" selected, values like 91 or 98.5 become JSON numbers, true and false become booleans, and empty cells become null. Choose "Keep everything as text" if you want every value as a string.

Why are some numbers kept as text?

Values with leading zeros, such as ZIP codes like 02134 or IDs like 007, stay as text so the zeros aren't lost. Very large integers beyond JavaScript's safe range also stay as text so they aren't rounded.

What if my column names repeat?

JSON objects can't have two keys with the same name, so a repeated column gets a number added, for example name and name_2. Empty header cells are named column1, column2 and so on.

Does the converter support quoted fields with commas and line breaks?

Yes. It follows the CSV standard (RFC 4180). A field in double quotes can contain the delimiter, line breaks and quotes written as two double quotes ("").

Last updated October 28, 2026 · By the ZTool team