CSV to JSON converter
Paste CSV or drop a file and get clean JSON back: an array of objects keyed by the header row, typed values, and optional nesting. Nothing is uploaded.
Loading the tool…How to use it
- Paste your CSV, drop a .csv file, or load the sample.
- Check the delimiter (auto-detect handles commas, semicolons, tabs and pipes) and whether row one is a header.
- Pick the output shape and copy or download the .json file.
Private by design
The conversion runs as JavaScript in this tab. Your data is not uploaded, logged or stored. There is no account and no file-size paywall.
Why some CSV fields get quotes
CSV looks trivial until a value contains the separator itself. Type a value, or pick one, and watch how a correct writer (RFC 4180) has to encode it, and how a naive “join with commas” breaks the row.
- Contains a comma → must be wrapped in quotes
- Contains a double quote → wrap in quotes and write each " as ""
- Contains a line break → must be wrapped in quotes
- Starts or ends with a space → quoting is optional but keeps the space safe
1,Ada,"Arlington, VA",UK
Parsed back: 4 fields ✓ — city = "Arlington, VA"
1,Ada,Arlington, VA,UK
Broken: parsed as 5 fields, so every column after the city shifts right.
How values are typed
CSV has no types: every cell is text. With “Detect numbers, booleans & nulls” on, 42 and 3.14 become JSON numbers, true/false become booleans, and empty cells or the word null become null.
Codes with a leading zero such as ZIP 02134 or product 007 stay strings, because turning them into numbers would silently drop the zero. Integers larger than JavaScript’s safe limit (9,007,199,254,740,991) also stay strings so IDs are not rounded.
Nested JSON from flat columns
Turn on dot-header nesting and a column named address.city becomes {"address": {"city": …}}. A header like tags.0 creates an array. This is the exact reverse of the flattening the JSON to CSV converter does, so you can round-trip data.
Which output shape to choose
Array of objects is what most APIs and JavaScript code expect. Array of arrays keeps it compact and preserves column order. JSON Lines (one object per line, also called NDJSON) streams well into BigQuery, Elasticsearch bulk loads and log pipelines. Keyed by first column gives you a lookup table such as {"1": {...}, "2": {...}}.
Convert CSV to JSON in code
For repeated or automated jobs, a few lines of code do the same thing. Python’s standard library csv.DictReader reads each row as a dictionary keyed by the header; json.dump writes it out. Note that DictReader leaves every value as a string, unlike the type detection above.
import csv, json
with open('input.csv', newline='', encoding='utf-8') as f:
rows = list(csv.DictReader(f))
with open('output.json', 'w', encoding='utf-8') as f:
json.dump(rows, f, indent=2, ensure_ascii=False)Questions
Is my file uploaded anywhere?
No. The file is read by JavaScript in this tab and never leaves your device. You can load the page, switch off Wi-Fi and it keeps working.
How big a CSV can I convert?
Files of tens of megabytes are fine on a laptop; the limit is your browser’s memory. For a 500 MB export, split it first with the CSV splitter.
Why does my JSON have column_1, column_2 keys?
The first row was treated as data or had empty header cells. Tick “First row is a header”, or name the empty headers in the CSV.
Does it handle commas inside quotes?
Yes. Parsing follows RFC 4180, so "Arlington, VA" stays one value and doubled quotes ("") become a single quote character.
How do I convert CSV to JSON in Excel?
Excel cannot save as JSON directly. Save the sheet as CSV (or use Excel to JSON here with the .xlsx), then convert. Power Query can also produce JSON, but only through custom M code.
How do I convert CSV to JSON in Python?
Use csv.DictReader plus json.dump (see the snippet above), or pandas: pd.read_csv("in.csv").to_json("out.json", orient="records").