Convert CSV to JSON
More data converters: JSON to Excel · JSON to CSV · Excel to JSON · XML to JSON · JSON to XML · XML to Excel · YAML to JSON · JSON Formatter
How to Convert CSV to JSON
From Excel, Google Sheets, a database export or any program. Comma, semicolon, tab and pipe are detected.
Header row, number detection, nested objects from dotted column names, and objects or plain arrays.
Copy the JSON into your code or download it as a .json file.
How the CSV is read
With "Detect numbers and true/false" on
| In the CSV | In the JSON |
|---|---|
12.50 | 12.5 — a number |
0019 | "0019" — stays text, so leading zeros in codes and postcodes are kept |
true, FALSE | true, false |
null | null |
| empty | "" — an empty string |
3,14 | "3,14" — decimal commas are left as text, because they cannot be told apart from a list |
- Quoted values follow the CSV standard: commas, quotes and even line breaks inside "double quotes" are read correctly.
- Header row: its cells become the keys. Empty headers are named
column_3and repeated ones get_2, so no value is lost. Switch it off to get every row, including the first, as a plain list. - Dots in headers make nested objects: columns
address.cityandaddress.zipbecome"address": {"city": …, "zip": …}— the reverse of what JSON to CSV does. - Numbers with more than 15 digits such as card-like IDs stay text, because JSON readers would round them.
- Output: Arrays gives
[["id","name"],[1,"Ana"]], useful for charts and compact files.
Starting from an Excel file? Use Excel to JSON to skip the CSV step. To turn CSV into a spreadsheet, use CSV to Excel.
Frequently Asked Questions
Is my CSV uploaded?
No. The CSV is read and converted by JavaScript in your browser. It is not sent to our server or stored.
Which separators are supported?
Comma, semicolon, tab and pipe. Detect looks at the first rows and picks the one that gives the same number of columns on each row; you can also choose it yourself.
Why did my postcode keep its leading zero?
Values starting with 0, like 0019, stay text on purpose so that codes, phone numbers and postcodes are not changed. Normal numbers become JSON numbers.
Can I get nested JSON from a CSV?
Yes. Name the columns with dots, like address.city, and switch on "Dots in headers make nested objects".