How to Convert CSV to JSON for Free, With Examples
CSV is the simple table format that spreadsheets export. JSON is the format that apps, websites and APIs read. Converting one to the other is a common job, and you do not need to write code or upload your data to do it.
A small example
This CSV has a header row and two data rows:
name,age,city Amal,29,Cairo Omar,34,Giza
As a list of objects, the JSON is:
[
{ "name": "Amal", "age": 29, "city": "Cairo" },
{ "name": "Omar", "age": 34, "city": "Giza" }
]
As a list of lists, it is:
[ ["Amal", 29, "Cairo"], ["Omar", 34, "Giza"] ]
Step by step
- Paste your CSV, or load the file.
- Leave the separator on automatic, or choose it yourself.
- Choose the JSON shape: objects when you want named fields, lists when you want plain rows.
- Choose the options, then press Convert.
- Copy the JSON, or download it as a .json file.
Which options to choose
- The first row is the header: the names of the columns become the keys of each object.
- Trim spaces: removes spaces around each value.
- Turn numbers into numbers: 29 becomes a number, not the text "29". Values such as 007 stay as text.
- Turn true and false into booleans: useful for yes and no columns.
- Turn empty values into null: so that a missing value is clear in the JSON.
Good to know
The tool runs on your device and your data is not uploaded. It handles commas inside quoted values, line breaks inside values, and files with Arabic text. If something looks wrong, read common CSV problems and how to fix them.
Convert a CSV file to clean JSON, with options for separators and number types. Free in your browser.
Open the CSV to JSON converter