CSV to JSON Converter

Convert CSV to JSON online with a real RFC 4180 parser: quoted fields, commas and line breaks inside values, delimiter detection and optional type inference.

commasemicolontabpipe Linecolumn

Convert CSV to JSON Online

Spreadsheets and database exports give you CSV, while JavaScript, REST APIs and NoSQL databases want JSON. This CSV to JSON converter reads the file the way RFC 4180 defines it, so commas, quotes and even line breaks inside quoted fields end up in the right place instead of breaking rows apart.

It detects the delimiter, uses the first row as keys, turns numbers, booleans and null into real JSON types if you want, and produces an array of objects or an array of arrays. Everything happens in your browser: the CSV is not uploaded anywhere.

CSV rows converted to JSON objectsid,name[{ … }]CSV to JSONConverter

How to convert CSV to JSON

  1. Paste the CSV or open a .csv or .tsv file. The JSON is generated as you type.
  2. Check the delimiter. Auto-detect handles comma, semicolon, tab and pipe; pick one manually if the guess is wrong.
  3. Decide on the header row and types. With a header, each row becomes an object keyed by the column names.
  4. Choose the output shape and format: array of objects or arrays, pretty-printed or minified.
  5. Copy the JSON or download it as data.json.

How the CSV parser handles tricky input

Splitting lines on commas breaks on real-world files. The parser follows RFC 4180 instead:

  • Quoted fields can contain the delimiter: "Wilmslow, Cheshire" stays one value.
  • Escaped quotes: two double quotes inside a quoted field are one quote, so "Say ""hi""" becomes Say "hi".
  • Line breaks inside quotes belong to the value, so a multi-line note does not start a new row. Line numbers in messages still refer to the real lines of your file.
  • Line endings: CRLF, LF and old Mac CR files all work, and a UTF-8 byte order mark at the start is removed.
  • Blank lines are skipped.
  • An unclosed quote stops the conversion with the line number where the quoted field starts, because everything after it would otherwise be swallowed into one value.

Delimiter detection parses the first 50 rows with each candidate and picks the one that gives the most consistent number of columns (at least two). Rows whose field count differs from the header are still converted, and the tool lists their line numbers so you can check them.

Type detection reference

With “Detect numbers, booleans and null” ticked, values are converted only when the conversion is lossless:

CSV valueJSON valueNote
42, -3.5, 1e342, -3.5, 1000Standard JSON numbers
0072"0072"Leading zeros stay text (postcodes, IDs)
9007199254740993"9007199254740993"Too large for an exact JavaScript number
1.501.5Numbers do not keep trailing zeros; untick to keep text
true, TRUE, Falsetrue, true, falseBooleans
null, NULLnullExplicit null
(empty)"", null or no keySet by “Empty fields”
1843-07-01"1843-07-01"Dates stay strings; JSON has no date type

Headers, duplicates and nested keys

  • Duplicate column names get a suffix: two name columns become name and name_2, so no value is overwritten.
  • Empty header cells become column3 (using the column position).
  • Extra fields in a long row are kept as column9, column10 and so on; short rows are filled according to “Empty fields”.
  • Nest dot.keys rebuilds objects from flattened headers: address.city and address.zip become {"address": {"city": …, "zip": …}}. This reverses the flattening of the JSON to CSV converter.
  • Array of arrays keeps every row, including the header, as a plain list, which is compact and preserves the column order.

Common uses

  • Seeding a database or a mock API from a spreadsheet.
  • Turning an Excel or Google Sheets export into fixtures for tests.
  • Preparing translation, product or pricing tables for a static site generator.
  • Checking what a CSV really contains when an import fails, since every value is shown exactly.

Starting from a PDF or XML file? Convert it first with PDF to CSV or go straight to JSON with XML to JSON.

Frequently Asked Questions

Common questions about converting CSV to JSON.

Paste the CSV into the converter. With “First row is the header” ticked, every following row becomes a JSON object whose keys are the column names. Copy the result or download it as a .json file.

Yes. Fields wrapped in double quotes can contain commas, line breaks and doubled quotes (""), as defined in RFC 4180.

Yes. Auto-detect recognises comma, semicolon, tab and pipe delimiters, and you can also pick the delimiter yourself.

Values with leading zeros such as 0072 and integers too large for JavaScript are kept as text so they are not changed. Untick type detection to keep every value as a string.

The row is still converted: missing values follow the “Empty fields” setting and extra values get keys like column9. The line numbers of those rows are listed so you can check them.

Yes. Tick “Nest dot.keys” and headers such as user.name and user.email become a nested user object.

There is no upload, so the limit is your browser’s memory. Files of several megabytes convert in well under a second on a typical laptop.

No. Parsing and conversion run in JavaScript on your device, and the download is created locally.