CSV to JSON Converter

Paste or upload a CSV file and get JSON output instantly. Auto-detects delimiter. Choose from four output formats including JSON Lines for MongoDB. Parse numbers, booleans and nulls automatically.

csv-to-json.tool
CSV Input
JSON Output

Four Output Formats

  • Array of objects — the standard format. Each row becomes a JSON object with header names as keys. This is what most APIs and JavaScript applications expect.
  • Keyed (col 1 as key) — the first column becomes the key of the top-level object. Instead of an array, you get a lookup object: {"Amaka": {"age": 28, ...}}. Useful for building dictionaries or hash tables from CSV data.
  • JSON Lines (NDJSON) — one JSON object per line with no array wrapper and no commas between objects. This is the format used by MongoDB imports, log pipelines, and streaming data systems. Each line is independently parseable.
  • Array of arrays — raw values in nested arrays, no header names. Useful when the consuming system provides its own schema or when you need the most compact possible representation.

Type Parsing

With "Parse numbers & booleans" enabled (the default), numeric strings like "450000" become numbers, and "true"/"false"/"null" become their JSON equivalents. This is almost always what you want when the JSON will be consumed by code. Disable it if you need to preserve the original string representation — for example, phone numbers with leading zeros or product codes that look like numbers.

"Empty → null" converts blank CSV cells to JSON null instead of empty strings "". Most databases and APIs treat these differently, so enable this if you need proper null semantics.

Delimiter Auto-Detection

The auto-detect option samples the first line and picks whichever separator appears most frequently outside of quoted fields — comma, semicolon, tab or pipe. It displays the detected delimiter in the stats row so you can confirm it found the right one. Override it manually if auto-detection gets it wrong on unusual files.

Frequently Asked Questions

Make sure "Parse numbers & booleans" is enabled (it is by default). Without it, every CSV value is treated as a string regardless of content. With it enabled, values that look like numbers are converted — so "450000" becomes 450000. If you have values that look like numbers but should stay as strings (like phone numbers or zip codes), disable this option.
JSON Lines (also called NDJSON or newline-delimited JSON) puts each object on its own line with no surrounding array and no commas between objects. Each line is a complete, independently parseable JSON object. It is used by MongoDB for mongoimport, by log aggregation systems like Elasticsearch and Splunk, and by big data pipelines that process records one at a time without loading the whole file into memory. If you are importing data into MongoDB, always use JSON Lines.
Keyed output uses the first column's value as the key of a top-level JSON object, and the remaining fields become the value object. If your CSV has an "id" or "name" column first, you get a lookup object like {"Amaka": {"age": 28, "city": "Lagos"}} instead of an array. This is useful when you need to look up records by a key rather than iterate through an array.
Yes. Set the delimiter dropdown to "Auto-detect" or manually select Semicolon. European Excel exports commonly use semicolons because commas are used as decimal separators in many European locales. Tab-separated values (TSV) exported from Excel or Google Sheets are also supported.
Transpose flips rows and columns before conversion. If your CSV has dates as rows and metrics as columns, transpose makes dates the columns and metrics the rows. The operation happens on the raw data before any JSON conversion, so all other options apply normally to the transposed data.
The upload button accepts files up to 5MB. For pasted content there is no hard limit, but very large pastes may slow down your browser since conversion runs live on every keystroke. For files larger than 5MB, use a command-line tool like jq or a Node.js script with a streaming CSV parser.