CSV ↔ JSON Converter

Convert CSV to a JSON array of objects, or a JSON array back to CSV. Choose comma, semicolon, tab or pipe as delimiter or let the tool detect it, decide whether the first row is a header, and infer numbers and booleans. Copy or download the result; the conversion runs in your browser.

How to use

  1. Choose CSV → JSON or JSON → CSV and paste your data into the input.
  2. Pick the Delimiter, or click Auto-detect to guess it from the CSV.
  3. Set First row is the header and, for CSV → JSON, Infer numbers and booleans and Pretty-print JSON.
  4. Copy the output or click Download (converted.json or converted.csv); Swap moves the result into the input and reverses the direction.

Example

Input

Delimiter: Semicolon · default options
sku;name;price;in_stock
A-1;"Desk; oak";149.90;true
B-2;Lamp;24;false

Output

[
  {
    "sku": "A-1",
    "name": "Desk; oak",
    "price": 149.9,
    "in_stock": true
  },
  {
    "sku": "B-2",
    "name": "Lamp",
    "price": 24,
    "in_stock": false
  }
]

Frequently asked questions

How are quotes, delimiters and line breaks inside a field handled?

Fields wrapped in double quotes may contain the delimiter and line breaks, and "" stands for a literal quote. When writing CSV, the tool quotes any field that contains the delimiter, a quote or a line break and doubles the quotes inside it (RFC 4180).

Why did my ZIP code lose its leading zero?

With Infer numbers and booleans on, values made only of digits become numbers, so 02134 turns into 2134; true, false and null are converted too. Turn the option off to keep every value as a string.

What happens if there is no header row?

Untick First row is the header and the keys are named column_1, column_2 and so on. In JSON → CSV, unticking it leaves out the header line.

How are nested objects converted to CSV?

The columns are all keys found in the objects, in order of first appearance. Nested objects and arrays are written into the cell as JSON text, and missing or null values become empty cells. A single object is treated as a one-row array.

Related tools