Skip to content

CSV to JSON Converter

Paste or drop a CSV file and get clean JSON you can use in code or an API. It also works the other way round.

Runs in your browser. Your file is never uploaded.

What it does

Each row of the CSV becomes one JSON object, with the header row as the keys. Numbers stay numbers, and values with commas inside quotes are kept whole.

orders.csv
id,product,qty
1001,Notebook,3
1002,"Stapler, heavy duty",1
orders.json
[
  { "id": 1001, "product": "Notebook", "qty": 3 },
  { "id": 1002, "product": "Stapler, heavy duty", "qty": 1 }
]

How to convert CSV to JSON

  1. Drop your CSV file into the box above, or click to choose it.
  2. Pick an output shape. Array of objects is what most APIs and JavaScript code expect.
  3. Click Download to save a .json file, or Copy to paste it somewhere.

Which output shape should I choose?

For a CSV like this:

name,city
Asha,Pune
Tom,Berlin

Array of objects uses the header row as keys. It's the easiest to read and to use in code:

[
  {"name": "Asha", "city": "Pune"},
  {"name": "Tom", "city": "Berlin"}
]

Array of arrays keeps the header as the first row. It's smaller, and handy for charting libraries and spreadsheets:

[["name","city"],["Asha","Pune"],["Tom","Berlin"]]

JSON Lines puts one object on each line. Data tools such as BigQuery, DuckDB and most log pipelines prefer it for large files, because they can read it line by line.

Things that commonly go wrong

Leading zeros disappear. A ZIP code like 02134 turns into the number 2134 when numbers are detected. If a column holds codes, not quantities, untick Detect numbers.

Commas inside values. A value like "Stapler, heavy duty" must be wrapped in double quotes in the CSV. Excel and Google Sheets do this for you when they export. This tool reads quoted values correctly.

Strange characters such as é. The file was probably saved in an older encoding. Re-save it from Excel as CSV UTF-8 and convert again.

Questions

Is my file uploaded anywhere?

No. The conversion runs in JavaScript inside this page. Your file is read by your own browser and nothing is sent to our server, so it is safe to use with customer or financial data.

How big a CSV can I convert?

Files up to 20 MB are converted instantly in the page. Larger files are converted by DuckDB, a database engine that runs in your browser and reads the file from your disk in pieces, then written straight to the download, so files of 1 GB and more work. You see a preview of the first 200 rows; the download contains everything. For very large files, JSON Lines is the most practical output.

Why are my numbers in quotes?

Turn on “Detect numbers and true/false”. With it off, every value is kept as text, which is safer for things like phone numbers, ZIP codes and IDs with leading zeros.

My CSV uses semicolons, not commas. Will it work?

Yes. The delimiter is detected automatically, so semicolon, tab and pipe separated files all work.

Can I convert JSON back to CSV?

Yes. Switch to “JSON → CSV” at the top of the tool. Nested objects are written as JSON text inside the cell; to spread them into separate columns, use the Flatten JSON tool instead.