§

Paste the CSV you want to convert to JSON.

Delimiter
First row is header
Type coercion
§

Output

json

Turning CSV into JSON is a daily task across US and UK data work: US Census Bureau bulk exports from data.gov ship as CSV that pipelines parse into JSON for ingestion into Snowflake or BigQuery, IRS Form 990 nonprofit-financials datasets land as CSV before charity-tracker apps reshape them into JSON records, and HUD American Community Survey extracts move the same way. UK fintech teams building toward Open Banking PSD2 conformance parse transaction listings from CSV (the format the FCA expects) into JSON (the format the Read/Write API speaks), and HMRC CSV exports of VAT records get converted to JSON before reconciliation. This converter runs the parse locally so proprietary financial, healthcare, or census-aligned records never reach a hosted converter.

What is CSV to JSON conversion?

CSV (Comma-Separated Values, RFC 4180) is a flat, tabular text format; JSON (JavaScript Object Notation, RFC 8259) is a tree-shaped text format for structured data. Converting CSV to JSON turns a spreadsheet-friendly table into an API-friendly array of objects — one object per row, with the header row supplying the keys — without retyping a single cell.

How does CSV to JSON conversion work?

Every conversion runs locally in your browser. The high-level steps are:

  1. You paste CSV into the input pane and press CONVERT; the tool parses the text and emits a JSON array of objects in the output pane.
  2. A character-by-character state machine (FIELD_START → IN_UNQUOTED_FIELD or IN_QUOTED_FIELD) walks the input, honours the "" quoted-quote escape, recognises both \r\n and \n row terminators, and produces a 2-D array of strings as the intermediate representation.
  3. If the first row is marked as a header, its cells become the object keys; otherwise the tool generates synthetic field0, field1, … keys so every row still maps to a complete object.
  4. Delimiter (comma, semicolon, tab, pipe, or auto-detect) and type coercion (numbers / booleans / null) are configurable. With coercion on, 30 becomes the number 30 and true becomes the boolean; with it off, every cell stays a string.
  5. Output is written to the read-only textarea as JSON.stringify-formatted text, and a download link builds a Blob with the application/json;charset=utf-8 MIME type so you can save the result with one click.

Why convert CSV to JSON with this tool?

  • Privacy: every parse and transform pass happens in your browser. The data never reaches our servers.
  • Correctness: the CSV parser is a real state machine. Fields containing quoted commas ("Bob, Jr."), embedded newlines, and escaped quotes parse to one cell, not three — naive split(',') implementations get this wrong.
  • Type fidelity: optional coercion turns numeric and boolean cells into real JSON numbers and booleans, so the array you get is ready to consume directly without a second cleanup pass.
  • Flexibility: pick any delimiter for non-comma CSV dialects, choose whether the first row is a header, and toggle type coercion for cases where every cell must stay a string.

What are common applications of CSV to JSON conversion?

Parsing CSV into JSON shows up across data work and tooling:

  • API mocking: pasting a CSV fixture exported from a spreadsheet and converting it to a JSON array your local server can return as a mocked endpoint.
  • Data import: turning a spreadsheet export (contacts, inventory, survey responses) into a JSON array your application or script can iterate without a CSV parser dependency.
  • Config editing: letting non-technical reviewers edit settings or feature flags cell by cell in a spreadsheet, then converting the saved CSV into the JSON your app actually loads.

What does a CSV to JSON example look like?

Pasting name,age on the first line, Alice,30 on the second, and "Bob, Jr.",25 on the third, then pressing CONVERT with the comma delimiter, first row as keys, and type coercion on, produces [{"name":"Alice","age":30},{"name":"Bob, Jr.","age":25}] — the quoted comma in "Bob, Jr." stays inside one field, and the ages become real JSON numbers.

Does this CSV to JSON converter run entirely in my browser?

Yes. Every parse and transform pass runs locally as JavaScript inside your browser tab. The tool does not call fetch, XMLHttpRequest, or navigator.sendBeacon at all — your CSV payload never reaches our servers, a third-party converter, or any analytics pipeline. The tool also works offline once the page has loaded, because it is a static HTML/CSS/JS bundle with no runtime API dependency.

What is the maximum input size this converter can handle?

The converter buffers the entire input in memory and runs synchronously on the main thread, so practical limits depend on your device. Inputs up to about 10 MB of CSV (roughly 100,000 typical rows) convert without a noticeable pause on a modern laptop. Beyond that the UI can stall while the parser runs. Streamed conversion using a Web Worker plus a chunked parser is a planned follow-up — for now, split very large datasets before pasting them in.

How does the CSV to JSON parser handle quoted commas and embedded newlines?

The parser is a character-by-character state machine with three states (FIELD_START, IN_UNQUOTED_FIELD, IN_QUOTED_FIELD) — not a naïve split(','). A field wrapped in double quotes can contain the delimiter, a CR, an LF, or a literal double quote escaped as "", all without breaking field boundaries. So "Bob, Jr.",25 parses to two fields, not three, and a multi-line description quoted across rows parses to a single cell.

How are numbers, booleans, and empty cells typed in the JSON output?

Typing is controlled by the Type coercion toggle. With coercion on (the default), a cell that looks like a number becomes a JSON number, true/false become booleans, and the literal null becomes JSON null; everything else stays a string. With coercion off, every value is kept as a string regardless of its contents — useful when leading zeros, phone numbers, or ID codes must survive intact. Missing trailing cells in a short row are emitted as empty strings so every object has the full key set.

Which delimiters does the CSV side support?

Four explicit delimiters are supported: comma (,, the RFC 4180 default), semicolon (;, common in European locales), tab (\t, the TSV dialect), and pipe (|). You can also pick Auto-detect, which counts each candidate's occurrences in the first 4 KB of input outside quoted regions and picks the most frequent one that yields a consistent column count across the first five rows.

This CSV to JSON converter parses with a real state machine and emits clean, ready-to-consume JSON you can paste straight into an API call, a script, or a code review — without uploading a single byte.