🔒 100% private — runs in your browser, nothing is uploaded

CSV to JSON Converter

Convert CSV to a JSON array — proper quoted-field parsing, delimiter and header options, files processed locally, never uploaded.

CSV looks simple until a field contains a comma, a quote or a line break — then naive split-on-comma converters produce garbage. This converter parses CSV properly, following the RFC 4180 conventions: a field wrapped in double quotes may contain the delimiter, literal line breaks, and double quotes escaped by doubling them. Paste your CSV or open a file — the file is read on your device and never uploaded — choose the delimiter (or let the page detect it), and get a clean JSON array you can copy or download.

Everything happens in your browser: files are read locally and never uploaded, and nothing is stored. Related tool: the reverse converter, JSON to CSV, is linked below.

Quick answers

How do I convert CSV to JSON?

Paste the CSV (or open the file), confirm the delimiter — comma, semicolon, tab and pipe are detected automatically — leave “First row is the header” ticked if your file has column names, and click Convert. Each data row becomes one JSON object keyed by the header names; copy the result or download it as a .json file.

If your CSV has no header row, untick the option: the output is then an array of arrays, exactly mirroring the input rows, so no data is invented or renamed.

How are commas, quotes and line breaks inside CSV fields handled?

By the CSV quoting rules (RFC 4180): a field wrapped in double quotes may contain commas, line breaks and quotes — a quote inside is written twice. This converter parses those fields as single values. The field "Ada, A." converts to the one string "Ada, A.", and a quoted note spanning two lines converts with a \n inside the JSON string.

This is where converters that simply split each line on commas fall apart — they would turn that one field into two columns and shift every value after it. The worked example below uses exactly that case, and the output on this page is what a correct parser produces.

Is my CSV file uploaded anywhere?

No. Files are read by your browser with the FileReader API and parsed in page memory; pasted text never leaves the page either. Nothing is sent to a server or stored, which is why the tool works the same on a customer export as on a toy example.

You can verify it in your browser’s network panel: converting makes no requests. Close or refresh the page and both the input and the output are gone.

How to use

  1. Paste CSV text into the input box, or use the file picker to open a .csv / .txt file — it is read locally, never uploaded.
  2. Check the delimiter: Auto-detect handles comma, semicolon, tab and pipe files; pick one explicitly if detection guesses wrong.
  3. Leave “First row is the header” on for keyed objects, or turn it off for an array of arrays; optionally convert numbers and true/false/null to native JSON types.
  4. Click Convert to JSON, check the row report under the output, then copy the JSON or download it as a file.

About this tool

With the header option on (the default), the first row names the keys and every following row becomes one JSON object. Turn it off and the output is an array of arrays, row for row, with nothing renamed or dropped. Either way the conversion is exact: values stay strings, exactly as written in the CSV, unless you tick the option to convert numbers, true/false and null into native JSON types.

Large files are handled the same way as small ones — the whole conversion runs in your browser’s memory, so a multi-megabyte export converts without a round trip to any server and without your data leaving the device. Rows that are shorter than the header are padded with empty strings, longer rows keep their extra fields under generated names, and the page reports any row whose field count differed so you can check your source file.

How it works

Parsing follows RFC 4180: records are separated by line breaks (CRLF, LF or CR), fields by the chosen delimiter; a field that starts with a double quote is read until its closing quote, may contain delimiters and line breaks, and a doubled quote ("") inside it means one literal quote. A leading byte-order mark (BOM) is stripped. With headers on, row 1 supplies the keys (duplicate header names are made unique with _2, _3 suffixes); short rows are padded with empty strings and extra fields are kept under extra_1, extra_2 keys — every such row is counted in the report under the output. Values are strings unless the type-conversion option is on.

Worked examples

Quoted commas, quotes and a line break: Input rows: name,note,qty as the header; then "Ada, A." with the note "She said ""hello"" and left" written across two lines, qty 3; then Bo with an empty note, qty 5. Output: [{"name": "Ada, A.", "note": "She said \"hello\"\nand left", "qty": "3"}, {"name": "Bo", "note": "", "qty": "5"}] — the comma inside the name stays inside one value, the doubled quotes become single quotes, and the line break becomes \n.

A semicolon file with detection on: Many European spreadsheet exports use semicolons. With Auto-detect, a file like sku;price / A-1;9.99 converts to [{"sku": "A-1", "price": "9.99"}] without changing any setting.

CSV conventions this converter follows (RFC 4180)

CaseRule
Delimiter inside a valueWrap the field in double quotes: "Ada, A." is one field
Quote inside a valueDouble it inside a quoted field: "say ""hi""" means say "hi"
Line break inside a valueAllowed inside a quoted field; becomes \n in the JSON string
Line endingsCRLF, LF and CR are all accepted, including mixed files

Frequently asked questions

Why do other converters break my file into the wrong columns?

Because they split each line on every comma. That works only when no field contains a comma, a quote or a line break. A real CSV parser tracks whether it is inside a quoted field and treats delimiters there as data — which is what this page does.

What output do I get if my CSV has no header row?

An array of arrays — one inner array per row, values in order, nothing renamed. Tick “First row is the header” only when the first row really holds column names; otherwise that first data row would be consumed as keys.

Are numbers converted to JSON numbers?

Only if you tick “Convert numbers, true/false and null”. By default every value stays a string, exactly as written — the safer choice for data like SKUs, leading-zero codes and long IDs, which numeric conversion would mangle.

What happens when rows have different numbers of fields?

The conversion still completes. Short rows are padded with empty strings and extra fields are kept under generated extra_N keys (or appended in array mode), and the report under the output tells you how many rows differed, so a malformed source file never fails silently.

How large a file can I convert?

As large as your browser’s memory comfortably holds — multi-megabyte exports are routine. There is no upload and no server limit, because there is no server involved; very large files simply take a moment longer to parse.

Is my data uploaded or stored?

No. Pasting and file reading both happen entirely in your browser; the file picker hands the file to the page on your device, not to us. Nothing is sent anywhere or saved — refresh the page and it is gone.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/csv-to-json-converter/" title="CSV to JSON Converter" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools