Skip to content
Utilboxes

CSV to JSON

To convert CSV to JSON, paste the data or load a file, check the detected delimiter and download the JSON. The first row becomes the keys of each object, numbers and true/false become real values, and codes with leading zeros such as 00042 stay as text. Quoted commas and line breaks are handled. Nothing is uploaded.

Runs entirely in your browser

Updated

How to use CSV to JSON

  1. 1Paste CSV, or load a .csv or .tsv file.
  2. 2Check the delimiter — it is detected automatically — and whether the first row is a header.
  3. 3Choose whether to detect numbers and whether to nest dotted headers such as address.city.
  4. 4Copy the JSON or download it as a .json file.

How it works

The parser follows RFC 4180, the closest thing CSV has to a standard. A value wrapped in double quotes may contain the delimiter, a line break or a doubled quote ("") that stands for one quote mark. A byte-order mark at the start, CRLF or LF line endings and a missing final line break are all accepted.

The delimiter is detected by parsing the first lines with a comma, semicolon, tab and pipe, and choosing the one that gives the most columns consistently. Separators inside quoted values are ignored, so an address with a comma does not fool it.

With type detection on, a cell becomes a number only when nothing can be lost: 3.5 and -12 become numbers, but 00042 keeps its leading zero and a 19-digit ID stays text because JavaScript numbers hold only about 15 significant digits exactly. TRUE and false become booleans, and empty cells become null.

Duplicate or blank header names are made unique (name, name_2, column3), so no column silently overwrites another. Rows with fewer cells get null for the missing values, and extra cells get their own column.

Everything runs in this page. Nothing you paste is transmitted, logged or stored, which is what makes it safe to drop a production payload in here while you are debugging.

Worked example

Two rows with a header, one value containing a comma

  1. id,name,postcode
  2. 1,"Hopper, Grace",01234
  3. → [{ "id": 1, "name": "Hopper, Grace", "postcode": "01234" }]

Result: The quoted comma stays inside the name, and the postcode keeps its leading zero as text.

Tips and common mistakes

  • Export from spreadsheets as “CSV UTF-8” so accented characters survive.
  • If every record lands in one field, the delimiter is wrong — pick it manually.
  • Use dotted headers such as address.city with nesting on to build nested JSON from a flat sheet.
  • Check the record count against the row count in your spreadsheet before using the output.

Frequently asked questions

How do I convert an Excel file to JSON?
Save or export the sheet as CSV from Excel (File → Save As → CSV UTF-8), then load that file here. Each row becomes an object keyed by the header row.
Why are some numbers kept in quotes?
Values with a leading zero, such as postcodes and account codes, and numbers longer than 15 digits stay as text so they are not changed. Turn off type detection to keep every value as text.
Can it handle semicolon or tab-separated files?
Yes. The delimiter is detected automatically, and you can choose comma, semicolon, tab or pipe yourself if the guess is wrong.
What if my CSV has no header row?
Untick “First row is a header” and each row becomes an array of values instead of an object.
Is my data uploaded?
No. The file is read and converted in your browser, so customer lists and exports stay on your device.
What does the warning about an unclosed quote mean?
A value starts with a double quote that never ends, so the rest of the file was read as one value. Look for a stray quote mark in the CSV, or a quote inside a value that was not doubled.