MegaTools.live

CSV to JSON

Turn a delimited table into JSON records using column headers as keys.

Up to 5 MB. Read on this device.

Options

How to use CSV to JSON

Paste a table or open a UTF-8 CSV file. Use the first row for unique column names. Choose Comma or Semicolon to match the export. A quoted field can contain a separator, a line break or a double quote written twice. Preview the result, then copy it or save a JSON file.

Worked example

Input
id,name,city
0042,"Patel, Ria",Surat
0043,Sam,Pune
Output
[
  {
    "id": "0042",
    "name": "Patel, Ria",
    "city": "Surat"
  },
  {
    "id": "0043",
    "name": "Sam",
    "city": "Pune"
  }
]

Keep IDs and postal codes intact

Every cell becomes a JSON string. An ID such as 0042 stays "0042" and an empty cell becomes "". Convert a field to a number or Boolean only when the receiving system requires that type.

Fix a record with the wrong number of fields

Each data record needs the same number of fields as the header. If a name such as Patel, Ria introduces an extra comma, put the entire name in double quotes. Keep a trailing separator when the final field is empty.