Skip to content
WebTricks

CSV ⇄ JSON converter

Convert CSV to a JSON array of objects, or JSON back to CSV. Handles quoted fields and custom delimiters.

JSON
[
  {
    "name": "Ada",
    "role": "Engineer"
  },
  {
    "name": "Grace",
    "role": "Rear Admiral, US Navy"
  }
]

About this CSV / JSON converter

Convert CSV → JSON (an array of objects keyed by the header row) or JSON → CSV (from an array of objects). The parser follows standard CSV rules: quoted fields may contain commas, newlines and escaped "" quotes, and you can switch the delimiter to a semicolon or tab. Everything runs in your browser.

How the mapping works

The first CSV row is treated as headers, and each following row becomes a JSON object. Going the other way, the converter collects the union of all keys in your JSON array as the header row, then writes one line per object — quoting any value that contains the delimiter, a quote or a newline.

FAQ

Does it keep numbers as numbers?

No — CSV has no types, so every cell becomes a string in the JSON output. That avoids guessing wrong (for example turning a ZIP code or version like 1.10 into a number). Cast values yourself if you need them typed.

Can it handle commas inside a field?

Yes. Fields wrapped in double quotes can contain commas, line breaks and escaped quotes, following the standard CSV rules.