CSV to JSON Converter

Convert CSV or TSV to a JSON array. Numbers and true/false become real JSON values, and columns like address.city can become nested objects.

The conversion runs in your browser; your file is never uploaded.

Detect automatically
Array of objects
JSON

This CSV to JSON converter turns a spreadsheet export, a database dump or any comma-, semicolon-, tab- or pipe-separated file into JSON you can use in code, an API request or a config file. It works out the delimiter for you, reads quoted values the way Excel writes them, and converts numbers and true/false into real JSON values instead of leaving everything as text.

Steps

  1. Add your data: paste CSV, open a .csv / .tsv file, or paste cells copied straight from a spreadsheet.
  2. Check the summary bar: it shows the delimiter that was detected, the number of records and the column names. Pick a delimiter yourself if it guessed wrong.
  3. Choose the shape: objects keyed by the header, or plain arrays of values for each row.
  4. Download or copy the JSON, indented or minified.

What the Output Looks Like

With the default settings, this CSV:

id,name,zip,active
1,"Khan, Ayesha",054000,true

becomes:

[
  {
    "id": 1,
    "name": "Khan, Ayesha",
    "zip": "054000",
    "active": true
  }
]

The quoted name keeps its comma, id and active become a number and a boolean, and the zip code stays a string so its leading zero survives. Choosing Array of arrays instead gives [["id","name","zip","active"],[1,"Khan, Ayesha","054000",true]], which is smaller and keeps the header as the first row.

Header Row Problems It Fixes

  • Blank header cells are named column_3 and so on, by position, so no data is dropped.
  • Repeated headers get a number: a second email column becomes email_2 rather than overwriting the first.
  • Rows longer than the header get extra column_N keys; shorter rows are filled in, so every object has the same keys.
  • The UTF-8 marker that Excel puts at the start of "CSV UTF-8" files is removed, so the first key is not polluted by an invisible character.

Semicolons, Tabs and Regional Excel Files

Excel uses the list separator set in the computer's regional settings. Where the comma is the decimal mark, as in much of Europe, it saves "CSV" files with semicolons. Detection counts the candidate delimiters in the first line, ignoring any inside quotes, and picks the most common one, so these files work without changing anything. Data copied from a spreadsheet is tab-separated and is detected the same way. Decimal commas inside values (12,5) are not converted to numbers, because JSON numbers use a dot.

Going the Other Way

To turn JSON back into a spreadsheet, use the JSON to CSV converter, which flattens nested objects into dotted columns that this tool can nest again. To tidy or check JSON before using it, paste it into the JSON formatter, and to get TypeScript types for the records, try JSON to TypeScript.

Frequently Asked Questions

How do I convert CSV to JSON?

Paste the CSV or open a .csv file. The JSON appears on the right as you type: by default an array with one object per row, keyed by the header row. Download it as a .json file or copy it.

How do I convert an Excel sheet to JSON?

In Excel or Google Sheets, save or download the sheet as CSV (File > Save As > CSV UTF-8 in Excel, File > Download > Comma-separated values in Sheets), then open that file here. Or select the cells, copy them and paste: copied cells arrive as tab-separated text, which is detected automatically.

Why are some numbers kept as text?

Values with a leading zero, such as the zip code 054000 or a phone number, would lose the zero as a JSON number, so they stay as strings. So do whole numbers longer than 9,007,199,254,740,991, which JavaScript cannot store exactly; long IDs keep every digit that way. Turn off Detect numbers & booleans to keep every value as text.

What does Nest dot keys do?

It turns column names with dots into nested objects: columns address.city and address.zip become "address": {"city": …, "zip": …}. It is the reverse of how the JSON to CSV converter flattens nested data, so a file can make the round trip.

What happens to empty cells?

With type detection on, an empty cell becomes null. With it off, it becomes an empty string. Rows shorter than the header get the missing fields the same way, so every object has the same keys.

Does it handle commas and line breaks inside values?

Yes. A value wrapped in double quotes can contain the delimiter, line breaks and quotes written as two double quotes (""), as the CSV standard RFC 4180 describes. If a quote is never closed, the error says on which line it opened.

Is my file uploaded?

No. The file is read and converted by your browser and never leaves your device.