CSV to JSON Converter

Turn CSV rows into a clean JSON array of objects, with the header row as the keys. The data stays in your browser.

Updated

Document ToolsPopular● Free No upload Instant

Loading CSV to JSON Converter…

Your browser is preparing the tool. It runs 100% locally.

Quick answer

Paste CSV and this returns a JSON array of objects: the header row becomes the keys, and every following row becomes one object. It follows the RFC 4180 rules, so quoted fields, commas inside quotes and doubled quotes are all handled. Every value comes out as a string (the number 30 becomes text), because CSV carries no type information to preserve.

What the CSV to JSON Converter does

Paste comma-separated data and the tool returns a JSON array. The first row is read as the field names, and each later row becomes an object keyed by them. It opens on a small name-age-city example, converts as you type, and lets you copy the result or download it as data.json.

Code, APIs and config files work in JSON, so this turns a spreadsheet export into a structure a program can loop over. In most codebases that is much easier to handle than raw CSV.

How it works

It parses the CSV character by character instead of naively splitting on commas. Double-quoted fields are respected, so a comma or line break inside quotes stays part of the value, and a doubled quote inside a field is read as one literal quote, as RFC 4180 specifies. Fully blank rows are dropped.

The first row becomes the list of keys, and each remaining row is paired with those keys to form an object. The array is then printed as JSON with a two-space indent.

Data source & conversion logic

No external data is involved. The conversion follows two specifications: RFC 4180 for reading the CSV, and the JSON syntax (RFC 8259 and ECMA-404) for writing the output. All of it runs in your browser.

  1. Step 1. Parse the CSV per RFC 4180, handling quoted fields, commas and line breaks inside quotes, and doubled quotes.
  2. Step 2. Take the first row as the list of keys.
  3. Step 3. For each remaining row, build an object pairing each key with its cell.
  4. Step 4. Drop fully empty rows.
  5. Step 5. Print the array as indented JSON (two spaces), then copy it or download data.json.

Privacy

Your browser parses the CSV you paste, and nothing goes to a server.

The page keeps no copy, so closing the tab clears the data.

That makes it a reasonable choice for customer lists, financial exports and other sensitive files.

Technical details

InputCSV text (header row expected)
OutputJSON array of objects (2-space indent)
DelimiterComma
QuotingRFC 4180 (doubled-quote escaping)
Value typesAll strings; no type inference
Empty rowsDropped
Downloaddata.json
Where it runsIn your browser, live

Standards and references

  • RFC 4180: the CSV reading rules: comma delimiter, optional double-quoting, and a doubled quote to escape a quote inside a field.
  • JSON (RFC 8259 / ECMA-404): the output syntax. JSON has six value types and strings are always double-quoted. The result is valid, parseable JSON.

Accuracy and limits

Every value is a string. CSV stores no types, so 30 comes out as text and so does true. Convert them in your own code if you need real numbers or booleans.

The first row is always treated as the header. A file with no header row will use its first line of data as the keys.

The delimiter is a comma. Semicolon- or tab-separated files won't split correctly here, so convert them to comma CSV first (the TSV to CSV tool helps).

If a row has fewer cells than there are headers, the missing keys are left out of that object; the tool doesn't invent a value.

Real-world uses

Feeding an API or app

Turn a spreadsheet export into the JSON array your code or endpoint expects.

Seeding data

Generate mock or seed records for a database or test suite from a CSV.

Scripting over a report

Convert an analytics or report export so a JavaScript or Python script can loop over it.

Inspecting structure

See flat CSV rows as labelled objects to understand the data's shape.

When it fits, and when it doesn't

Good for

  • Turning CSV with a header row into JSON objects
  • Preparing data for code, APIs or config
  • A quick structured view of a CSV
  • Generating seed or mock data

Not the best choice for

  • CSV with no header row
  • Semicolon- or tab-delimited files
  • Preserving number, boolean or date types

No header row? Add one first. Semicolon or tab data? Convert it to comma CSV (TSV to CSV) first. Need typed numbers? Convert the string values in your own code after importing.

Frequently asked questions

How does it map CSV to JSON?
The first row becomes the object keys, and every later row becomes one object pairing those keys with the row's cells. The whole set comes back as a JSON array.
Why are my numbers strings in the output?
Because CSV has no type information; every cell is just text. The number 30 is stored the same way as the word Paris, so the converter keeps them all as strings. Convert them to numbers in your code if you need to.
Does it handle commas inside a field?
Yes, as long as the field is wrapped in double quotes, which is the RFC 4180 convention. The parser keeps a quoted comma as part of the value instead of treating it as a separator.
How are quote characters inside a field handled?
By the RFC 4180 rule: a double quote inside a quoted field is written as two double quotes, and the parser turns that back into a single literal quote.
What if my CSV has no header row?
The tool always treats the first row as the keys, so a file without a header would use its first data row as field names. Add a header line first for a clean result.
Does it support semicolon or tab delimiters?
No, it reads comma-separated values only. Convert a semicolon or tab file to comma CSV first; the TSV to CSV tool handles the tab case.
What happens to blank lines?
Fully empty rows are dropped, so a stray blank line in the middle or at the end of the file won't create an empty object.
What if a row has fewer values than there are headers?
The missing trailing keys are left out of that object instead of being filled with a guess, so you get only the fields that were actually present.
Is my data uploaded anywhere?
No. The parsing happens in your browser, so nothing you paste is sent or stored.
Can I download the JSON?
Yes. Copy it from the output box, or use Download to save it as data.json.
Does it convert nested structures?
CSV is flat, so the output is a flat array of flat objects. There is no nesting to recreate.
Is the output valid JSON, and what indent?
Yes, it's valid per RFC 8259 and indented with two spaces, so it's easy to read and paste straight into code.

References

The converter reads CSV by the RFC 4180 rules and writes valid JSON. Every value lands as a string, because CSV carries no type information.

Popular

JSON to CSV Converter

Flatten a JSON array of objects into CSV for a spreadsheet. Every key found in any object becomes a column, and it all runs on your device.

DocumentOpen Tool

CSV to Excel Converter

Turn pasted CSV into a real .xlsx workbook with SheetJS. Cells are written as text, so Excel can't strip leading zeros or turn codes into dates when the file opens.

DocumentOpen Tool

Excel to CSV Converter

Pull the first sheet of an Excel workbook out to plain CSV in your browser. Formulas become their values, and the file stays on your computer.

DocumentOpen Tool
Trending

Markdown to HTML

Convert the Markdown you use every day (headings, emphasis, code, links, images and bullet lists) to clean HTML in your browser. It covers a subset of Markdown, not full CommonMark.

DocumentOpen Tool

Word to Text Extractor

Extract the plain text from a Word .docx file in your browser. You get the words without the formatting, and your document is read on your device instead of being uploaded.

DocumentOpen Tool
PopularHot

Image Compressor

Compress an image to JPEG with a quality slider and watch the file size drop as you drag, in your browser.

ImageOpen Tool

Back to the CSV to JSON Converter

Paste or pick your input at the top of the page. The conversion runs on this device and needs no account.