Type Sniffing · NDJSON · Local

CSV to JSON — with proper types, not just strings.

Automatically detects numbers, booleans, and null in CSV values. Outputs JSON array or NDJSON, pretty or compact. Live preview, 1-click copy, no tracking. Built for developers pulling mock data, seeds, or static-site content from spreadsheets.

.json
Default output
NDJSON
Streaming mode
0 B
Uploaded

CSV to JSON Converter

Drop the file, tweak options, copy or save the JSON.

{ }

Drop CSV here

or click to browse — .csv, .tsv, .txt

JSON Preview

    
See all CSV tools →

Why this CSV-to-JSON converter?

Tailored to dev workflows, with the options other tools skip.

🔢

Type sniffing for JS-friendly data

"42" → 42, "true" → true, "null" → null, "3.14" → 3.14, "" → null. obj.age > 18 or filter(u => u.active) works without cast boilerplate. Toggleable when you need strict strings.

📡

NDJSON for streaming pipelines

One object per line, no wrapping array. Loki, ELK, BigQuery, ClickHouse, and any line-oriented pipeline accept NDJSON natively — and can stream line-by-line without holding the whole dataset in memory.

👁️

Live preview in the browser

Instead of blindly downloading, you see the first ~6 KB formatted right on the page. Spot misparsed values or wrong headers before committing to your repo.

📋

1-click copy to clipboard

For small datasets download is overkill. One click on "Copy" — JSON in clipboard, ready for VS Code, Postman body, or Storybook state.

🔧

Delimiter your choice

Auto-detection by default, manual override for edge cases — TSVs with .csv extension, pipe-CSVs from DB dumps, semicolon-CSVs from European Excel.

🔒

Code-ready, zero data risk

Even "test" CSVs often contain real data (user tables, orders). Files stay in your browser — ideal for sensitive seed data in repo setups where server round-trips aren't acceptable.

How to convert CSV to JSON

Three steps. Preview included.

1

Drop CSV

Drag-and-drop or file dialog. First row = JSON keys.

2

Pick format

Pretty/compact/NDJSON, type sniffing on or off, delimiter if auto fails.

3

Copy or save

1-click copy for fast iteration, file download for repo commits.

Real-world use cases

Where CSV-to-JSON shows up in real dev projects.

🎭

API mocks & Storybook fixtures

Designer hands you an Excel list of test users; you need JSON for the MSW or JSON-Server mock. Export CSV, run it here, type sniffing on for IDs and booleans — ready to wire into the mock.

🌱

Database seed scripts

Prisma seed, Sequelize fixtures, TypeORM data sources — all want JS/JSON arrays. Master data (categories, countries, default roles) often lives in an Excel/CSV. Paste the JSON output straight into seed.ts.

🌐

Static-site generators (Astro, Eleventy, Next.js)

SSGs love sourcing content from JSON or NDJSON. Product lists, team bios, FAQ entries — maintained as a spreadsheet (so non-devs can edit), shipped as JSON into content/.

📊

Frontend state from Excel data

Dashboards, analytics pages, or internal tools often want a semi-static data baseline. Instead of building a backend route to read the Excel, compile JSON straight into the bundle — faster first paint, less infrastructure.

🧮

Data science: pandas, jq, pipelines

For pd.read_json(), Jupyter notebooks, and CLI pipelines with jq, JSON is often a more convenient input than CSV. Quick conversion, then onward with familiar tools.

🤖

LLM prompting & fine-tuning

OpenAI, Anthropic, and Hugging Face APIs commonly want NDJSON for batch calls and fine-tuning datasets (e.g. {"prompt": "...", "completion": "..."}). Convert training CSV to NDJSON here — securely, because no data leaves your browser.

Frequently asked questions

CSV stores everything as text. When converting to JSON, it's usually useful to write "42" as a number, "true" as a boolean, and "null" as JSON null rather than as strings. Type sniffing detects this automatically. You can also turn it off so all values remain strings.

JSON array: all records in one big array — [{...},{...},{...}]. Great for frontend state, static-site data, small APIs. NDJSON (newline-delimited JSON): one object per line, no wrapping array. Ideal for streaming, log pipelines (Loki, ELK, BigQuery), and processing huge datasets without loading the entire content into memory.

The first CSV row is interpreted as the key header. name,age,city becomes {name:..., age:..., city:...} per record. Whitespace in header names is preserved — JSON keys can be arbitrary strings, but for JavaScript property access whitespace-free (or snake_case) headers are nicer.

Yes, RFC 4180 compliant: cells containing the delimiter, quotes, or newlines are unwrapped from their quotes properly; doubled quotes are collapsed to single ones. Complex fields like addresses with commas work without special configuration.

Currently flat objects only (key-value pairs from the CSV header). If you need nested structures like {user:{name:...,email:...}}, export flat first and transform in a follow-up step with jq or a short JS script.

Up to about 100,000 rows runs smoothly in the browser. For very large datasets (500k+ rows), prefer streaming CLI tools (csvkit, miller, jq) — browser RAM isn't the ideal place for them.

Yes — the BOM (3 bytes EF BB BF at the file start) is stripped before the first CSV cell is interpreted. You won't end up with an invisible key like "name" in the output.

No. Parsing and JSON generation runs entirely in JavaScript in your browser. No server roundtrip. The page works offline once loaded.

Convert CSV to JSON — for API mocks, seeds, and static sites

Modern JavaScript/TypeScript stacks (React, Vue, Svelte, Astro, Next.js, Nuxt) spend a fair amount of time turning any data source into JSON you can import. But the source data often comes from spreadsheets maintained by product, sales, or content teams. Our converter bridges that gap directly in the browser: CSV export from Excel in, JSON out — with options the basic CSV hub doesn't offer (type sniffing, NDJSON, pretty-print, 1-click copy).

Type sniffing — why it matters in JSON workflows

The biggest frustration with naive CSV-to-JSON conversion: everything's a string. "42" becomes "42" (string), not 42 (number). Filters, aggregations, and comparisons in the frontend don't work without explicit casts: parseInt(obj.age), obj.active === 'true'. With our type sniffing this is done up front — the JSON file contains native types: 42 as a number, true/false as booleans, null as null. Optionally disabled when you consciously want strings (e.g. for Postgres COPY into pure TEXT columns).

NDJSON — streaming format for modern data

JSON arrays have a downside: they must be fully parsed before you can access the first element. With 100,000 records, memory is a real concern. NDJSON (Newline-Delimited JSON) solves it: one object per line, no wrapping braces, no commas between objects. Tools like jq -c, BigQuery imports, ClickHouse, Loki, and the ELK stack accept NDJSON natively. It's also the standard for OpenAI fine-tuning and Anthropic batch APIs.

Delimiter auto-detection with manual override

In most cases the tool detects the CSV delimiter from the structure of the first rows (comma vs. semicolon vs. tab vs. pipe). For edge cases — single-column CSVs or unusual delimiters — set it manually. Particularly handy when mixing files from European Excel (semicolon) with US tools (comma).

Live preview and 1-click copy for fast iteration

Instead of the classic "download, open in editor, copy, paste, check, retry" cycle, you see the first ~6 KB of JSON formatted right on the page. Spotted something off (typo in header, wrong delimiter, value not parsed as number)? A second lost, not a minute. The copy button puts the full JSON in your clipboard — perfect for Storybook stories, MSW handlers, or quick tests.

Privacy by design — relevant especially for test data

"Test data" is often real anonymized data — or worse, non-anonymized real data that accidentally landed in a test setup. A foreign cloud CSV-to-JSON site is risky here (potential data processor relationship, opaque storage). BrowserCrunch processes everything locally — the file never leaves your browser. Bonus: works offline once the page is loaded.

Related CSV tools on BrowserCrunch

Other direction? Our JSON-to-CSV converter with flattening for API reports. For office workflows: CSV to Excel and Excel to CSV. Bioinformatics: TSV to CSV.