Home / Developer tools / CSV to JSON

CSV to JSON Converter

Turn CSV into JSON in one step. The delimiter is detected for you, numbers and booleans become real JSON values, and quoted fields with commas and line breaks are handled correctly.

Options

JSON result

Table preview (first 50 rows)

How to convert CSV to JSON

  1. Paste your CSV into the box, or open a .csv file. A sample is loaded so you can see the result at once.
  2. Check the detected delimiter, and say whether the first row is a header.
  3. Choose the JSON layout and the indent. The result updates as you type.
  4. Copy the JSON or download it as a file.

Example

id,name,active,city
1,Alex Morgan,true,"Dubai, UAE"
2,Sam Lee,false,London
[
  { "id": 1, "name": "Alex Morgan", "active": true, "city": "Dubai, UAE" },
  { "id": 2, "name": "Sam Lee", "active": false, "city": "London" }
]

JSON layouts

  • Array of objects: one object per row, with the header names as keys. The most common layout, and the one that APIs and JavaScript expect.
  • Array of arrays: one array per row, with the header as the first row if you want it. Compact, and good for charts and tables.
  • Object keyed by a column: the value of one column, such as an id, becomes the key of each row.
  • Object of columns: each header holds an array of all values in its column.

Types and empty values

CSV has no types, so every value is text. With type detection on, the converter turns plain numbers into JSON numbers and true and false into booleans, and leaves everything else as text. Values that only look like numbers stay text: a zip code such as 01234, a phone number such as +971 4 000 0000, and any number with more than 15 digits, which a JSON number cannot hold exactly. Empty cells can become an empty string, null, or be left out of the object.

Nested keys

Tick the nested keys option and a header such as address.city creates an object, { "address": { "city": "Dubai" } }. This is the reverse of flattening, which the JSON to CSV converter does.

What it handles correctly

  • Fields in double quotes that contain commas, quotes (written as two quotes) and line breaks.
  • Comma, semicolon, tab and pipe delimiters, and the byte order mark that Excel adds to UTF-8 files.
  • Windows, Unix and old Mac line endings.
  • Duplicate and empty headers, which are made unique, and rows with too few or too many columns, which are reported.

Private and free

The conversion runs in your browser. Your data is not uploaded, and there is no limit and no sign up.

To go back, use JSON to CSV. For array output, wrappers and JSON Lines, see CSV to JSON array. For files and a table preview, see CSV to JSON online, and read the CSV vs JSON guide to choose a format. You may also need the YAML to JSON converter, the JSON to XML converter or the JSON diff tool.

Frequently asked questions

How do I convert CSV to JSON?

Paste the CSV or open the file, and the JSON appears at once. Choose the layout and indent you need, then copy or download it.

Does it detect the delimiter?

Yes. Comma, semicolon, tab and pipe are detected automatically, and you can also choose one by hand.

Why is a zip code with a leading zero kept as text?

A number such as 01234 would lose its zero in JSON. The converter keeps values like this, and very long numbers, as text.

Is my CSV uploaded to a server?

No. The conversion happens in your browser and the data never leaves your device.