JSON & Data

How to Convert CSV to JSON

Turn a CSV file from a spreadsheet, database export, or report into clean JSON that you can use in an API, a config file, or a script.

Tool Used

CSV to JSON

Open tool
1

Open the CSV to JSON converter

Navigate to /tools/json/csv-to-json.

2

Paste or upload your CSV

Paste your CSV text into the input area, or click the upload button to load a CSV file from your computer. The first row should contain the column headers, which become the keys in the JSON output.

3

Pick the delimiter

Most CSV files use a comma as the column separator, but some use a semicolon (common in European exports), a tab (TSV files), or a pipe character. Pick the delimiter that matches your input. The tool can usually detect it automatically.

4

Choose how to handle types

Decide whether numbers and booleans should be parsed (so 42 becomes a JSON number and true becomes a boolean) or kept as strings (so 42 stays as the string "42"). Parsing types is usually what you want for APIs, while keeping strings is safer for data that has leading zeros or codes.

5

Read the JSON output

The converted JSON appears below the input. Each CSV row becomes one object in a top level array. The keys are taken from the header row. You can choose between pretty formatted JSON and minified JSON.

6

Copy or download

Click Copy to grab the JSON for use in your code, or click Download to save it as a .json file. Paste the result into a request body, a config file, a database seed, or anywhere structured data is needed.

All done!

You are ready to use CSV to JSON like a pro.

Try it now
All guides