Convert CSV to JSON
APIs, config files, fixtures, NoSQL imports — sooner or later tabular data needs to become JSON. The shape you almost always want is an array of objects: each row becomes {"…header": "value"}, keyed by the header row. That’s exactly what this converter emits, with two decisions most converters get wrong left under your control: whether values are typed, and whether you need one giant array or one object per line.
Typed (the default) means numeric strings become JSON numbers, empty cells become null, and true/false become booleans — with the crucial exception that leading-zero values like ZIP code 02134 stay strings, because "zip": 2134 is corrupted data. Untyped keeps everything as strings, byte-faithful to the CSV. And because it runs on the same streaming engine as the rest of this site, a million-row CSV converts without freezing the tab.
Preset: the JSON export panel opens as soon as your file loads.
Drop a CSV, TSV or Excel file here
.csv · .tsv · .txt · .csv.gz · .xlsx — files up to 4 GB open here, in your browser. Nothing is uploaded; the file is read in place on your device.
Filters combine with AND. Use the search box for a quick any-column match. Regex filters use JavaScript syntax.
Untick to hide a column (hidden columns are left out of exports). Type to rename — renames apply to exports too.
Exports include your filters, sort, edits and cleanups. Hidden columns are left out; renamed headers apply. The file is generated on your device — nothing is sent anywhere.
How it works
- Drop the CSV — headers become the JSON keys (toggle “First row is header” if there are none; keys fall back to col_1, col_2…).
- Filter or clean first if you only need a subset — the export honors the current view.
- Pick JSON (one array) or NDJSON (one object per line), typed or not.
- Download. For very large outputs, prefer NDJSON — it streams into other tools line by line.
JSON array or NDJSON — which do you need?
A single JSON array ([{…},{…}]) is what config files, test fixtures and most web APIs expect — but a consumer must parse the whole thing before using any of it. NDJSON (newline-delimited JSON, also called JSON Lines) puts one complete object per line; it’s the native bulk format for MongoDB’s mongoimport, Elasticsearch’s _bulk, BigQuery load jobs and most log pipelines, and it can be processed line-by-line with constant memory. Rule of thumb: hand-editable or consumed at once → JSON array; feeding a database or pipeline, or over ~100k rows → NDJSON.
Nesting is the one thing CSV can’t express: a flat row can only become a flat object. If you need {"address": {"city": …}}, convert flat here first, then reshape in code — a converter that guesses at nesting from column-name dots tends to guess wrong in ways that are painful to detect.
Good to know
- Duplicate header names collapse into one key in JSON — rename columns in the Columns panel first if your CSV has repeated headers.
- IDs that must stay strings (leading zeros, >15 digits) are protected automatically in typed mode — spot-check one row if your IDs matter.
- Hidden columns are left out of the JSON entirely — a quick way to drop internal fields before sharing.
Frequently asked questions
How are empty cells represented?
Typed mode writes null (the JSON idiom for missing); untyped mode writes "" (the literal CSV content). Pick based on the consumer: most APIs and databases treat null as absent but "" as a real empty string.
Can it convert JSON back to CSV?
Not here — flattening arbitrary nested JSON into columns is a different (and messier) problem than row-to-object conversion. This page does CSV/TSV/XLSX → JSON only.
What happens with a million-row file?
It works — conversion streams through the file with a progress bar. Choose NDJSON at that scale: a single million-entry JSON array is legal but miserable for whatever parses it next.
Are numbers like 007 or 4111111111111111 converted to JSON numbers?
No — that’s the point of the guardrails. Leading-zero values and digit strings longer than 15 characters stay JSON strings, because converting them to numbers destroys them (007 → 7; 16-digit IDs lose their last digit to float rounding). Ordinary numbers like 42 or 9.99 do become real JSON numbers in typed mode.