CSV to JSON Converter

Paste CSV or TSV — or upload a file — and get a pretty-printed JSON array or NDJSON, with numbers and booleans inferred per column instead of left as strings. Everything runs in your browser; nothing is uploaded.

Generated JSON

How column types are decided

JSON has no notion of "a column" — it's just values — so the converter scans every value in every CSV column first, the same type-inference pass used by the CSV to SQL converter, and decides a type per column rather than per cell:

  • A column where every non-empty value parses as a whole number or decimal is emitted as JSON number.
  • A column where every non-empty value is exactly true or false is emitted as JSON boolean.
  • Everything else — including dates, since JSON has no native date type — is emitted as a JSON string, exactly as written in the CSV.
  • If even a single value in an otherwise-numeric column doesn't parse (an N/A, a stray label), the whole column falls back to strings rather than dropping or corrupting that one value.
  • Values with leading zeros, like zip codes, are left as strings — parsing "007" as the number 7 would silently destroy the zeros.

Very large integers (beyond JSON's safe 253 range, which Number.isSafeInteger enforces) are kept as strings instead of numbers, since converting them would silently lose precision — the same failure mode as pasting a 19-digit ID into a spreadsheet and watching the last few digits turn to zeros.

JSON array vs. NDJSON

A JSON array wraps every row as an object inside a single [ ... ] array — one JSON document, valid input for JSON.parse(), most REST APIs, and config files. NDJSON (newline-delimited JSON) drops the surrounding array and the commas between rows, writing one complete JSON object per line instead. Streaming tools, log pipelines, and bulk loaders — the BigQuery/Snowflake JSON loaders, the Elasticsearch/OpenSearch bulk API, jq -c — prefer NDJSON because each line can be read and parsed independently, without holding the whole file in memory.

This tool infers types from the CSV text alone; it doesn't know your real destination schema. Treat the output as a solid first draft — for a strict, versioned mapping from spreadsheet columns to typed fields, define the target shape explicitly rather than relying on inference for anything you'll depend on in production.

Frequently asked questions

How do I convert a CSV file to JSON?

Paste CSV into the converter above, or click "Upload a file" to load a .csv/.tsv file from disk. The first row is treated as column headers by default, the delimiter — comma, tab, or semicolon — is detected automatically, and the JSON output updates as you type. Copy it or click Download to save a .json/.ndjson file. Everything runs locally in your browser.

What's the difference between a JSON array and NDJSON?

A JSON array wraps every row as one object inside a single [ ... ] array — the whole thing is one JSON document, which is what most "give me JSON" APIs and config files expect. NDJSON (newline-delimited JSON) writes one JSON object per line with no surrounding array or commas between rows, which streaming tools, log pipelines, and bulk-loaders (BigQuery, Elasticsearch bulk API, jq -c) prefer because each line can be parsed independently without reading the whole file into memory.

How are column types decided — numbers, booleans, or strings?

Every value in every column is scanned first. If every non-empty value in a column parses as a number, the whole column is emitted as JSON numbers; if every value is true/false, it's emitted as JSON booleans. If even one value in the column doesn't fit, the entire column falls back to JSON strings, so a column that's 99% numeric but has one N/A stays a string column rather than silently dropping that row's value. Dates are kept as strings, since JSON has no native date type.

How are empty CSV fields handled?

By default empty fields become JSON null. Uncheck "Empty fields as null" to emit empty strings ("") for text columns instead — empty values in a numeric or boolean column are always null, since "" is not a valid JSON number or boolean.

How many rows can I convert?

The converter builds JSON for up to 5,000 rows. If you paste or upload more, it converts the first 5,000 and shows a warning instead of silently truncating. For larger files, process them in chunks or use a script-based CSV-to-JSON conversion instead of a browser tool.

Is my data uploaded to a server?

No. The converter is plain JavaScript running entirely in your browser — pasted text and uploaded files are read locally, and the page makes no network requests with your data. You can disconnect from the internet after the page loads and it keeps working.

Need to query that data instead of just converting it?

Jam SQL Studio is a free desktop SQL client for SQL Server, PostgreSQL, MySQL, Oracle, and SQLite — import CSV, XLSX, and JSON files into a real table with a guided wizard, then browse, filter, and export the results in any format.

Free for personal use • No account required • Mac, Windows, Linux

More free SQL tools