CSV to JSON Converter

Convert CSV rows into an array of JSON objects, using the header row as keys. Quoted fields, embedded commas and multi-line values are handled correctly.

Delimiter: Indent:
Copied
CSV Input0 B
JSON Output0 B

What this converter produces

The converter reads CSV and returns a JSON array with one object per data row. The first row of the CSV supplies the property names, so a header of id,name and a row of 7,Ada become {"id": "7", "name": "Ada"}. This is the shape most JavaScript code, document databases and REST APIs expect when they take a list of records.

Parsing follows the quoting rules of RFC 4180: a value in double quotes may contain the delimiter, line breaks and doubled quotes ("") that stand for one literal quote. The output is standard JSON as defined in RFC 8259, so a line break inside a value appears as \n in the result.

How to convert CSV to JSON

  1. Paste CSV into the CSV Input pane, open a file with File, or load one with URL. The first row must hold the column names.
  2. Set Delimiter to match the file. There is no auto-detection on this page.
  3. Choose an Indent and click Convert.
  4. Use Copy, or Download to save converted.json.

Options explained

Rules the converter follows

Example

A semicolon-separated export, converted with Delimiter set to Semicolon:

sku;name;price;in_stock
0042;"Lamp; LED";12,50;yes
0043;Chair;49,00
[
  {
    "sku": "0042",
    "name": "Lamp; LED",
    "price": "12,50",
    "in_stock": "yes"
  },
  {
    "sku": "0043",
    "name": "Chair",
    "price": "49,00",
    "in_stock": ""
  }
]

The quoted "Lamp; LED" stays one value, the leading zeros in the SKU are kept, and the second row, which is one field short, gets an empty in_stock. If you need real numbers and booleans, convert the fields you care about in code:

const typed = rows.map(r => ({
  ...r,
  price: Number(r.price.replace(",", ".")),
  in_stock: r.in_stock === "yes"
}));
// [{ sku: "0042", name: "Lamp; LED", price: 12.5, in_stock: true }, ...]

Common problems and fixes

SymptomCauseFix
Keys such as "id;price"The file uses semicolons but Delimiter is set to Comma.Select Semicolon. If you are unsure which delimiter a file uses, open it in the CSV Formatter, which detects it.
Values cut short, data shifted into the wrong keysA value contains the delimiter but is not quoted in the source.Quote that value in the CSV, or re-export it from the source application.
Error saying a quoted field is never closedA value starts with " and the closing quote is missing.Fix the line named in the message; a quote that belongs to the text must be doubled.
A column is missing from every objectTwo columns share a header name, so one overwrote the other.Rename one of the headers before converting.
Accented letters look wrongThe file is not UTF-8 (for example an old Windows-1252 export). Files are read as UTF-8.Re-save the file as UTF-8 in your spreadsheet or editor, then load it again.

Frequently asked questions

Why are numbers in quotes in the JSON?

Because the converter keeps every value as text. Guessing types would turn postcodes, phone numbers and IDs such as 0042 into numbers and lose the leading zeros. Convert specific fields after parsing, as in the example above.

What if my CSV has no header row?

The first row is always used as the keys. Add a header line with the names you want, such as col1,col2,col3, before converting.

Can it create nested JSON from dotted headers?

No. A header like address.city becomes a key with a dot in it, not a nested object. The JSON to CSV converter creates such dotted headers when it flattens nested data, but this page does not reverse that step.

Are values that span several lines supported?

Yes, as long as they are quoted. A cell such as "1 High St followed by Leeds" on the next line becomes one value, "1 High St\nLeeds", in the JSON.

Is my CSV uploaded?

No. The file is read and converted by JavaScript in your browser and nothing is sent to a server. The URL button is the one exception: it fetches the address you enter, directly from your browser.

Guides

Related tools