Free web tool
CSV to JSON
Convert CSV and TSV files to JSON, or to JSON Lines. The header row gives the keys, columns that hold only numbers become numbers, and everything else stays exactly as typed. The file is read on your device. Nothing is uploaded.
Bytes of your files sent anywhere: 0
Files are read and converted in this tab, in a background worker. The only requests the page makes are for its own scripts. Your files are never sent anywhere.
How it works
The page reads the file's encoding and separator, splits it into rows the way a spreadsheet would, with quoted fields, commas and line breaks inside quotes, and writes one JSON object per row, using the header row for the keys.
Types are decided per column. A column becomes numbers only if every value in it is a plain number that writes back exactly as typed, so 3.50, 02134 and version numbers like 1.10 stay strings, and a column with one ZIP code that starts with 0 stays all strings. A column of only true and false becomes booleans, and an empty cell becomes null.
Keys keep the order of the header, even keys like 2024 that JavaScript would normally sort first. With the nesting option, user.name and user.age become one user object, which undoes what JSON to CSV does to nested data.
How to convert CSV to JSON
- Pick JSON or JSON Lines. JSON gives one array; JSON Lines gives one object per line, which suits big files and tools like jq and BigQuery.
- Check the options. Keep the header and types on for most files. Turn types off to get every value as a string.
- Add the files. Drop the CSV files on the box, click it to choose them, or paste one.
- Download. Download each JSON file from its row, or use Download all as .zip.
Limits
- Up to 50 MB a file and 5 million cells, and up to about 200 MB of JSON. JSON Lines output is smaller.
- A column is typed as numbers only when every value in it is a number written the plain way. Values such as 1e5, 3.50 or -0 keep the whole column as strings, which never loses a digit.
- Dates stay strings, since JSON has no date type.
- A file whose first character is [ or { is read as JSON, not CSV; use JSON to CSV for those.
Questions
Are my files uploaded?
Will my ZIP codes and IDs keep their leading zeros?
Should I choose JSON or JSON Lines?
What happens to empty cells and repeated headers?
Can it make nested objects?
Is it free?
If this saves you time, you can leave a tip. It helps keep these tools free and online.