My Tool Studio
Developer

CSV to JSON Converter

This CSV to JSON converter reads a table and turns every row into a JSON object, using the header cells as keys. Paste CSV or TSV, drop or upload a .csv file or an Excel sheet, or load a CSV from a URL, and the delimiter is detected for you. Numbers and true or false become real JSON types, while zip codes, phone numbers and IDs with leading zeros stay text. You can also get arrays of arrays, an object keyed by the first column or one array per column, build nested objects from headers such as address.city, and choose what empty cells become. Output comes indented, minified or as JSON Lines, ready to copy or download. It runs in your browser.

Always freeNo sign upRuns in your browser
JSON appears here.

How to use

01

Add your CSV

Paste CSV or TSV, drop or upload a .csv, .tsv, .xlsx, .xls or .ods file, or press Load URL. For a workbook with several sheets, pick one in the Sheet menu. Try sample loads a small table.

02

Set options and convert

Check the delimiter and whether the first row is the header, then pick the Output shape, Indent, Empty cells and Nested keys settings. Press Convert to JSON; changing an option updates the result.

03

Copy or download the JSON

Press Copy, or Download to save .json (.jsonl for JSON Lines). Warnings about rows with too few or too many fields appear below the panes, and Show the parsed table displays the rows as read.

Why CSV to JSON Converter

Example: CSV input and JSON output

The sample CSV has a header row, id,name,zip,active,score,address.city,address.country, and three rows. One name contains a comma, so it is quoted as "Smith, Bob". Two zip codes start with 0, and the last row has an empty score.

The table shows how each kind of cell comes out, first with Detect numbers and booleans ticked (the default) and then with it unticked. Every row becomes one object in a JSON array, with the header cells as keys.

Set Nested keys to split on a dot and the two address columns become one address object with city and country inside it.

CSV cellColumnDetection onDetection off
1id1"1"
Alicename"Alice""Alice"
"Smith, Bob"name"Smith, Bob""Smith, Bob"
02134zip"02134" (leading zero kept)"02134"
trueactivetrue"true"
9.5score9.5"9.5"
(empty)score"" by default, or null or no key""

Exporting CSV from Excel and Google Sheets

Spreadsheet apps can all save CSV, but the menu names and defaults differ. A clean export avoids most conversion problems, especially with accents and delimiters.

  • Excel: File, Save As, then choose CSV UTF-8 (Comma delimited). The UTF-8 version keeps accented characters intact. Excel saves only the active sheet.
  • Google Sheets: File, Download, Comma-separated values. Only the sheet you are viewing is exported.
  • Apple Numbers: File, Export To, CSV, then choose Unicode (UTF-8) text encoding.
  • If your Excel uses a comma as the decimal separator, it may save with semicolons. Leave Delimiter on Auto-detect or choose Semicolon.
  • For a quick job, select the cells, copy, and paste them here. Copied cells arrive tab-separated, which the converter reads as TSV. You can also upload the .xlsx file itself.
  • Check the first line of the exported file. If it is not the header row, untick First row is the header or use Skip lines at top to jump past title rows.

Common questions

How do I convert an Excel sheet to JSON?
Upload the .xlsx, .xls or .ods file directly, or drop it on the input. Each sheet is read as CSV in your browser, and when the workbook has several sheets a Sheet menu lets you switch between them. You can also select cells in Excel or Google Sheets, copy and paste them, which arrives as tab-separated text.
Can I convert CSV without a header row?
Yes. Untick First row is the header and the keys become field1, field2 and so on. Choose Array of arrays as the Output if you would rather have plain rows without keys.
How do I get nested JSON from CSV columns?
Set Nested keys to split on a dot, a slash or a double underscore. A header such as address.city then becomes an address object with a city key, and several columns that share a prefix end up in the same object.
Why did my zip codes or IDs lose their leading zeros?
They should not here. With Detect numbers and booleans ticked, only values written like plain JSON numbers become numbers, so 02134, +44 20 and very long IDs stay strings. If another tool dropped the zeros, the damage was done before the CSV was saved; untick detection here to keep every value as text.
Is there a size limit for the CSV file?
There is no fixed limit, but the file is parsed in your browser, so very large files can make the tab slow or run out of memory. Everyday exports convert quickly. For very large files, split them or use a script.
What does the delimiter setting do in the CSV to JSON converter?
Auto-detect looks at the first lines and guesses the separator. Choose one yourself when the guess is wrong, for example for semicolon files saved by Excel in many European locales, or for a file with a single column.
How are empty cells converted to JSON?
The Empty cells menu decides: an empty string (the default), null, or leaving the key out of that object. Completely blank lines are skipped.
What happens if a CSV row has more or fewer fields than the header?
The row is still converted and a warning says how many rows had a different number of fields. Missing fields get the Empty cells value. Extra fields are kept in an array under the key _extra, so no data is lost.
Does the converter handle quoted CSV fields with commas and line breaks?
Yes. A field wrapped in double quotes can contain commas and line breaks, and two double quotes inside it stand for one. "Smith, Bob" becomes the single value Smith, Bob.
Can I convert tab-separated TSV data to JSON?
Yes. Auto-detect usually picks up tabs, or you can choose Tab. Cells copied straight from Excel or Google Sheets are tab-separated, so you can paste a selected range and convert it.

More Developer tools

View all