Toolbench

CSV to JSON and JSON to CSV converter

Paste CSV to get a JSON array of objects, or switch direction to turn JSON into a CSV with one column per key.

Runs entirely in your browser. Nothing you type, paste or open here is uploaded to any server.

How do I convert CSV to JSON?

Treat the first row as keys and turn each following row into an object with those keys. Paste your CSV here and the JSON appears on the right, with numbers and true or false converted to real types.

  1. Choose CSV to JSON or JSON to CSV.
  2. Paste your data or open a file.
  3. Set options: typed values, dot-key nesting, or flattening.
  4. Copy or download the output.
  5. Use Use output as input to round-trip and check the data.

Examples

CSV to JSON

Input

name,seats,active
Acme,5,true

Result

[
  {
    "name": "Acme",
    "seats": 5,
    "active": true
  }
]

Nested keys

With nesting on, a header named address.city becomes {"address": {"city": ...}}. In the other direction, flattening turns nested objects back into dot columns.

Frequently asked questions

Does it handle commas inside quotes?

Yes. The parser follows the common CSV rules: quoted fields can hold commas, line breaks and doubled quotes.

Why did a ZIP code lose its leading zero?

Values with a leading zero, like 01234, stay as text. Turn off Convert numbers if other ID columns must stay exactly as typed.

What JSON shapes can I convert to CSV?

An array of objects works best. An object holding one array is also accepted. Arrays inside a record are written into one cell as JSON text.

Is my data uploaded?

No. The conversion runs in your browser.

Related news

Related tools