Skip to content

CSV to JSON Converter

Convert CSV to a JSON array with one object per row, keyed by the header line.

Input · CSV
⇄
Output · JSON
Valid CSVRuns in your browser

Load from a URL

Your browser fetches it directly, so the server must allow cross-origin requests (CORS).

How to convert CSV to JSON

  1. Paste CSV or open the file. The JSON updates as you type.
  2. Leave Delimiter on Detect or pick one. Header row turns the first line into keys.
  3. Press ⇄ to send the JSON to JSON to CSV.

Example: a semicolon export

Spreadsheets in many European locales save CSV with semicolons:

order_id;customer;total;paid;zip
1001;Anna Kowalska;149,90;TRUE;02134
1002;"Jansen; B.V.";89.5;false;
1003;Luca Rossi;12;true;0451

Output with the defaults, plus the note Delimiter detected: ";".:

[
  {
    "order_id": 1001,
    "customer": "Anna Kowalska",
    "total": "149,90",
    "paid": true,
    "zip": 2134
  },
  {
    "order_id": 1002,
    "customer": "Jansen; B.V.",
    "total": 89.5,
    "paid": false,
    "zip": null
  },
  {
    "order_id": 1003,
    "customer": "Luca Rossi",
    "total": 12,
    "paid": true,
    "zip": 451
  }
]

"Jansen; B.V." is quoted, so it stays one field.

What Numbers & booleans changes

With Numbers & booleans on (the default):

  • 1001 and 89.5 become numbers; true, TRUE and false become booleans.
  • Empty cells become null.
  • 149,90 stays text: only a dot counts as a decimal point.
  • Leading zeros are lost: 02134 became 2134.
  • Integers too large for JavaScript (above 9,007,199,254,740,991) stay strings, so long IDs keep every digit.

Off, every value stays as written: "02134", "TRUE", and "" for empty cells.

Rows that do not line up

Rows with more or fewer fields than the header still convert, and a note counts them. Missing fields are left out of that row’s object; extra values go into a __parsed_extra array. An unclosed quote stops the conversion with the row number.

View the result as a grid in JSON to table or generate types with JSON to TypeScript.

Questions

How do I get arrays instead of objects?

Turn off Header row. Every line, the first included, becomes an array of values.

Can it read an Excel file?

Save the sheet as CSV first: in Excel, File, Save As, CSV UTF-8 (Comma delimited), which keeps accented letters. Then open that file here.

Can a cell contain a line break?

Yes, inside a double-quoted cell. It is kept in the JSON string as \n.

Related tools

Esc