CSV to JSON Converter

Convert CSV data from Excel or Google Sheets into clean JSON.

CSV Input

Ln 1, Col 1Empty

JSON Result

Your JSON will appear here.
No result yet

What Is a CSV to JSON Converter?

A CSV to JSON converter turns rows from a CSV file into a list of JSON objects. Each row becomes one object, and the first row of the CSV becomes the keys. This is useful when you want to move data from Excel or Google Sheets into a website, an app, or an API.

How to Convert CSV to JSON

  1. Paste your CSV into the CSV Input box, click Upload, or click Sample to try an example.
  2. Keep the separator on Auto detect, or choose comma, semicolon, or tab.
  3. Choose whether to convert numbers and true/false values.
  4. Click Convert to JSON.
  5. Check the JSON or Table tab, then click Copy or Download to save the result.

What I Found While Testing

When I tested this converter with a small product list, I noticed that some product names came out with extra spaces in front, like " Notebook" instead of "Notebook". This happens easily when you copy data from Excel, an email, or a website. So I updated the tool to remove extra spaces around each value automatically. Numbers such as prices and quantities are still converted into real numbers.

CSV to JSON Converter result showing clean product names Notebook and Pen with numeric price and quantity values
After the fix: names are clean, and prices and quantities stay as numbers.

Features

  • Uses the first row as JSON keys automatically.
  • Detects comma, semicolon, and tab separators.
  • Handles quoted values that contain commas, such as "Lahore, Pakistan".
  • Converts numbers, true, false, and null into real JSON types.
  • Turns columns like contact.email into nested JSON objects.
  • Runs in your browser, so your data is not uploaded to a server.

Example

CSV
id,name,city,contact.email,active
1,Emily Clark,"Lahore, Pakistan",emily@example.com,true
2,James Smith,London,,false
JSON
[
  {
    "id": 1,
    "name": "Emily Clark",
    "city": "Lahore, Pakistan",
    "contact": { "email": "emily@example.com" },
    "active": true
  },
  {
    "id": 2,
    "name": "James Smith",
    "city": "London",
    "contact": { "email": "" },
    "active": false
  }
]

The first row becomes the keys, the quoted city keeps its comma, contact.email becomes a nested object, and 1 and true become a real number and boolean. An empty cell becomes an empty string.

Tips for Clean Results

  • Exporting from Excel: use File → Save As → CSV UTF-8, so letters like é and ü are kept.
  • Semicolons instead of commas? European Excel often uses semicolons. The separator is detected automatically, or you can pick it yourself.
  • Codes and phone numbers: values with a leading zero, like 00123, always stay text. Turn off type conversion if other number-like codes, such as IDs or phone numbers, must stay text too.
  • Use clear headers: they become your JSON keys, so first_name works better than First Name (required).

Copying a table from a README or a chat answer? Use Markdown Table to JSON. Need it the other way? Use JSON to CSV or create a real spreadsheet with JSON to Excel. Starting from an .xlsx file? Excel to JSON reads it directly, no CSV export needed. When to use which format is explained in JSON vs CSV.

Frequently Asked Questions

Does the first row need to be a header?

Yes. The first row is used as the names of the JSON keys. Empty header cells are named column1, column2, and so on.

Why are some numbers kept as text?

Values with leading zeros, such as 007 or phone numbers, are kept as text so that no digits are lost.

Can I convert JSON back to CSV?

Yes. Use our JSON to CSV Converter to turn JSON data into a CSV file for Excel or Google Sheets.

Can I format the JSON result?

The result is already formatted. You can also paste it into our JSON Formatter to minify it or change the indentation.