Purplelink
← All tools

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.

Options
Save as

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

  1. 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.
  2. Check the options. Keep the header and types on for most files. Turn types off to get every value as a string.
  3. Add the files. Drop the CSV files on the box, click it to choose them, or paste one.
  4. Download. Download each JSON file from its row, or use Download all as .zip.

Limits

Questions

Are my files uploaded?
No. The page reads each file with your browser and converts it in a background worker in this tab. There is no server step. The meter under the drop zone counts the bytes the page and its worker send while they work, so you can check this yourself. The only things the page downloads are its own scripts.
Will my ZIP codes and IDs keep their leading zeros?
Yes. A column becomes numbers only if every value in it is a plain number, so a ZIP code column with 02134 in it stays strings, and every ZIP keeps its zeros. Long IDs of 12 digits or more always stay strings.
Should I choose JSON or JSON Lines?
JSON for a file you will load in one go in JavaScript or Python. JSON Lines, one object per line, for big files, log tools, jq, BigQuery and anything that reads records one at a time.
What happens to empty cells and repeated headers?
An empty cell becomes null, or an empty string if you turn types off. A repeated header gets (2) after it, and a missing one is called column 3 and so on, so no value is lost.
Can it make nested objects?
Yes. With the nesting option, headers like user.name and user.age become {"user": {"name": ..., "age": ...}}. A header that is both a value and a parent, such as a next to a.b, stays flat so nothing is overwritten.
Is it free?
Yes. There is no account, no watermark and no limit beyond the sizes above.

If this saves you time, you can leave a tip. It helps keep these tools free and online.