Convertur

Convert CSV to JSON

Convert CSV to JSON. Each row becomes an object keyed by the header row, in a formatted JSON array, and numbers and booleans are detected. No upload.

Loading tool...

What is CSV?

CSV stands for comma-separated values. Spreadsheets and databases use it to export data. Each line is a row, and commas split the columns. Values that contain commas or line breaks are wrapped in double quotes.

Why convert CSV to JSON?

APIs, config files, test fixtures and JavaScript code all use JSON. Turn a spreadsheet export into JSON and you can pass it to a program, seed a database or mock an API without editing it by hand.

How to convert CSV to JSON

Drop one or more .csv files above and press Convert. Papa Parse reads each file in your browser. The first row becomes the object keys and each row after it becomes one object in a JSON array, indented with two spaces. Numbers and booleans are detected, so "42" becomes the number 42 and "true" becomes true. Empty lines are skipped. Download the .json files one by one or as a ZIP.

Things to check

The file must use commas. For semicolon or tab separated files, convert TSV to CSV first or open the file in a spreadsheet and save it as CSV. Values such as 00123 are read as numbers and lose their leading zeros, so check ZIP codes and IDs in the result. If a column has no header, its key in the JSON will be an empty name.

Before you start

Input: CSV. Output: JSON. The settings appear before anything runs, so you can check them first. Your original file is never changed.

A valid file can still hold the wrong data. Before you import the result, check the row count, field names, text encoding, dates, IDs and a few unusual rows.

Keep the original until you have opened and checked the result. The work happens in this browser tab, so the size you can handle depends on your device's memory, your browser and the file itself.

Steps to convert CSV to JSON

  1. Drop a .csv file into the box above.
  2. The header row is used as the JSON keys.
  3. Press Convert to parse it in your browser.
  4. Download the JSON.

Last updated · How we build and check tools · Report an error

Learn more

Related tools

CSV to JSON FAQ