CSV to JSON Converter

Convert CSV files to JSON, NDJSON, or column arrays

Free, no signup. Runs entirely in your browser — files stay on this device.

Your fileCSV · TSV · TXT

Drop your file here or browse from your device

Accepts CSV, TSV, TXT. Maximum input: 10 MiB. Files above this hard limit are rejected before local processing.

Read in this browser tab · 0 bytes uploaded

CSV to JSON at a glance

Output shapesArray of objects, Array of arrays, Column arrays, and NDJSON (JSON Lines / .ndjson)
Type detectionOpt-in and conservative: parses safe numbers, booleans, and null while keeping leading zeros (00741), phone numbers (+1555...), and >15-digit IDs as strings
Nested headersOptional dot and bracket expansion turns user.name and tags[0] into nested JSON objects and arrays, reporting any path conflicts
Empty cellsChoose empty string (""), null, or omit the key entirely for sparse API payloads
HeadersBlank headers are named by position and duplicate headers gain numeric suffixes so columns are never overwritten silently
PrivacyRuns 100% locally in your browser — nothing is sent to a server

Convert a CSV file to JSON in your browser: upload or paste the data and get formatted JSON back immediately. Nothing is uploaded to a server, so you can convert exports that contain customer records, internal IDs, or anything else you would not paste into an unknown website.

Most converters emit one shape — an array of objects — and stop there. This one also writes NDJSON (JSON Lines) for log pipelines and bulk-import endpoints, arrays of arrays when you need the raw grid, and column arrays when a charting or dataframe library wants each field as its own list.

The details that usually break an import are handled explicitly. Type detection is opt-in and conservative, so a ZIP code like 007 or a 20-digit order number stays a string instead of silently becoming a different number. Headers such as user.name or tags[0] can expand into real nested objects and arrays, and if two columns would collide the tool tells you rather than overwriting a value.

Continue your workflow

Finished this step? Take the result into a focused tool for what comes next.

How to Convert CSV to JSON

  1. Upload your CSV file or paste CSV data into the tool
  2. Pick a JSON structure in the Shape options — array of objects, array of arrays, column arrays, or NDJSON
  3. Optionally enable type detection, nested header expansion, and how empty cells should be written
  4. Review the JSON preview, then copy it or download the .json or .ndjson file

Choosing the Right JSON Output Shape

Different APIs, databases, and front-end libraries expect very different JSON layouts from the same CSV table. Picking the right shape up front avoids writing a throwaway script to reshape the output afterward.

  • Array of objects ([{...}, {...}]): The default for REST APIs, webhook payloads, MongoDB imports, and JavaScript/TypeScript test fixtures. Each row becomes an object keyed by the header row.
  • NDJSON / JSON Lines ({...} per line): Writes one compact JSON object per line with no wrapping brackets. Preferred by BigQuery, Elasticsearch bulk indexing, Snowflake, and streaming log pipelines because readers can parse line by line.
  • Column arrays ({ col: [...] }): Groups every column into its own parallel array — ideal for Chart.js, Plotly, Apache Arrow, or dataframe constructors where series are indexed by column.
  • Array of arrays ([[...], [...]]): Preserves the raw positional grid including the header row, useful when passing tabular data to Google Sheets APIs or spreadsheet components.

Worked Example: Nested Headers & Safe Type Detection

Aggressive CSV-to-JSON converters coerce anything digit-like into a JSON number, corrupting ZIP codes (00741 → 741) and 64-bit snowflake IDs beyond Number.MAX_SAFE_INTEGER. Here, type detection only converts exact, lossless JSON numbers, booleans, and null — while dot/bracket header expansion builds clean nested payloads in one pass.

CSV with nested headers & leading-zero ZIP → Typed nested JSON
// Input CSV
order_id,postal_code,user.name,tags[0],tags[1],active,total
900719925474099312,02115,Ada Lovelace,vip,eu,true,49.95

// Output JSON (Type detection + Expand nested headers enabled)
[
  {
    "order_id": "900719925474099312",
    "postal_code": "02115",
    "user": { "name": "Ada Lovelace" },
    "tags": ["vip", "eu"],
    "active": true,
    "total": 49.95
  }
]

Features

  • Four output shapes: array of objects, array of arrays, column arrays, and NDJSON
  • Optional type detection for numbers, booleans, and null
  • Numeric safety — leading zeros, phone numbers, and IDs beyond double precision stay strings
  • Expand dot and bracket headers (user.name, tags[0]) into nested objects and arrays
  • Choose whether an empty cell becomes "", null, or an omitted key
  • Blank and duplicate headers renamed so no column is silently dropped
  • Pretty-printed or minified output, copy or download
  • Runs entirely in your browser — the file is never uploaded

Use Cases

  • Turn a spreadsheet export into the array of objects a REST API expects
  • Produce NDJSON for bulk indexing, log pipelines, or line-delimited ingestion
  • Build JSON fixtures and seed data for tests from a CSV of sample records
  • Reshape a flat export into nested request bodies using dot-path headers
  • Feed column arrays straight into a charting or dataframe library
  • Convert config or reference tables maintained in a spreadsheet into JSON

Frequently Asked Questions

How do I convert a CSV file to JSON?

Upload the CSV or paste it into the box, choose an output structure, and the JSON preview updates immediately. Copy it or download the file. The conversion runs in your browser, so nothing is sent to a server.

What JSON structures can I output?

Four. Array of objects uses your header row as keys and is what most APIs expect. Array of arrays keeps the raw grid with the header row first. Column arrays give one array per field. NDJSON writes one compact JSON object per line.

What is NDJSON and when should I use it?

NDJSON (also called JSON Lines or JSONL) puts one complete JSON object on each line with no wrapping array. Streaming consumers, bulk-import endpoints, and log tooling prefer it because a reader can process one line at a time without loading the whole document.

Will my ZIP codes and IDs be turned into numbers?

Only if you ask for type detection, and even then the rules are deliberately strict. A value keeps its string form unless it is an exact JSON number that a double can hold without loss, so 007, +15551234, 1.2.3, and a 20-digit order number all stay strings.

Can I create nested JSON from a flat CSV?

Yes. Enable "Expand nested headers" and a column named user.name becomes {"user":{"name":...}}, while tags[0] and tags[1] become an array. If a nested path would overwrite another column the tool keeps that column flat and reports it instead of losing the value.

How are empty cells handled?

You choose. An empty cell can stay an empty string, become null, or have its key left out of the record entirely — which is often what an API validating optional fields expects.

What happens to duplicate or blank column headers?

Both are renamed so every column stays addressable: blanks become column_2 style names by position, and a repeated header gains a numeric suffix. The tool lists what it renamed so the mapping is never a surprise.

Is my data private?

The CSV is parsed and converted in your browser and its contents are not sent to the app server. As with any website, avoid opening highly sensitive files on a device or browser you do not trust.

Need to convert the other way? Try our JSON to CSV Converter