How to use the CSV to JSON
- Paste CSV into the input box or upload a .csv file.
- Choose output format: array of objects (most common) or array of arrays.
- Keep "Detect numbers & booleans" on to output 29 instead of "29".
- Copy the JSON or download it as a .json file.
Output formats
Array of objects uses the header row as keys: [{"name":"Asha","age":29}, …]. This is what most APIs, JavaScript code and NoSQL databases expect. Array of arrays keeps the table shape, with the header as the first row, and is compact for charting libraries and spreadsheets. Object of columns groups values by column, which suits plotting code.
Type detection
With type detection on, values that look like numbers become JSON numbers and true/false become booleans. Empty cells become null. Turn it off to keep every value as a string, which is safer for IDs with leading zeros such as ZIP codes.
Worked example
Three rows of CSV and the "array of objects" result with number detection on:
| CSV input | JSON output |
|---|---|
id,name,age,active | [ |
With number detection off, every value stays a string: "age":"29".
Common CSV to JSON problems
IDs losing leading zeros. Values like 00123 and numbers with 16 or more digits are kept as strings even with number detection on, so ZIP codes, phone numbers and long IDs are not damaged. Semicolon CSV from European Excel. The separator is detected automatically, and title lines above the header are skipped. Duplicate column names. JSON objects can’t have two identical keys, so a second "Value" column becomes "Value (2)". Empty cells. They become null with number detection on, or empty strings with it off.
Need the reverse? Click JSON → CSV at the top of the tool: your JSON result is carried over and converted back without leaving the page.
Choosing the right JSON shape
An array of objects is the standard shape for web APIs and JavaScript: each row becomes {"name":"Asha","age":29}, so every value is labelled by its column. It is easy to read but repeats the column names in every row, so the file is larger. An array of arrays is more compact and better when you will feed the numbers to a chart library or a numeric routine. If the same field names are not needed in every row, consider that JSON can omit empty fields, but most tools simply write null.
Data types matter
CSV has no types: everything is text. JSON does: numbers, strings, booleans and null are different things, and mixing them up breaks programs. The string "29" and the number 29 behave differently when sorted or added. Convert true numbers to numbers, keep identifiers such as ZIP codes, phone numbers and product codes as strings, and decide how to treat empty cells (null or an empty string) before sending the file to another system. The format comparison guide explains the differences in more depth.
Validating the result
After converting, check that the number of objects equals the number of CSV rows, that the keys match your header names, that no key is duplicated or empty, and that nested values are as expected. Paste the output into a JSON validator or load it in your code to confirm it parses. Special characters such as quotes and line breaks inside a CSV field must be escaped in JSON, which the converter does automatically, but it is good practice to open one such row and check it.
Frequently asked questions
- Can I convert JSON back to CSV here?
- Yes. Click "JSON → CSV" at the top of the tool. The current result moves to the input box and is converted the other way.
- How do I keep IDs like 00123 as text?
- Values with leading zeros and very long numbers are always kept as strings. To keep every value as text, turn off "Detect numbers".
- How do I convert CSV to JSON?
- Paste the CSV or upload the file. The JSON appears instantly; click Download or Copy.
- Does it handle commas inside quotes?
- Yes. Quoted fields with commas, quotes ("") and line breaks are parsed correctly.
- Is there a file size limit?
- Only your browser’s memory. Files of several megabytes convert in a second or two.
- Is my data uploaded?
- No. Conversion happens in your browser; nothing is sent to a server.
- How do I convert CSV to JSON in Python?
- Use the csv module: import csv, json; rows = list(csv.DictReader(open("data.csv", encoding="utf-8"))); json.dump(rows, open("data.json", "w"), indent=2). Note that every value is a string, so convert numbers yourself, which is what the type detection here does for you.
- Does CSV to JSON keep my column order?
- Yes. Keys appear in the same order as the CSV header, and rows keep their original order.
Guides that go with this tool
Last updated: · by Dev Patel ·Read our guides