CSV to JSON

Paste CSV or open a file and get JSON right away. The delimiter is detected for you, the first row becomes the keys, and IDs such as 007 are left alone. The data is converted in your browser tab and is not uploaded.

CSV to JSON

How to convert CSV to JSON

  1. Paste your CSV into the CSV box, or click Open a CSV file and choose a .csv, .tsv or .txt file.
  2. Leave Delimiter on Detect automatically. Choose comma, semicolon, tab or pipe only if the result looks wrong.
  3. Keep First row is the header ticked if row 1 holds column names. Untick it to get a list of lists.
  4. Decide on Turn numbers and true/false into JSON values. Untick it to keep every cell as text.
  5. Read the result, then use Copy JSON or Download .json.

What this CSV to JSON converter does

It reads the text you give it with Papa Parse, a widely used CSV library, and writes a JSON list with one object per row. The result appears as you type or paste. With the header ticked, the first row supplies the keys. The Indent option switches between a readable layout and one compact line: our 4-row sample file (154 bytes) came out at 446 bytes indented and 301 bytes compact.

One thing leaves your browser, and it is not your data. The first time you use the tool, the page downloads Papa Parse from a public CDN (cdnjs), and the browser checks the file against a fixed hash before running it. In our request log that was a single GET with no body. Nothing we logged carried the text we typed or the files we opened. Only Chromium was tested.

Commas, semicolons, tabs and pipes

Detect automatically worked on all four of our sample files: comma, semicolon (a European export), tab and pipe. The pipe file has a field holding a,b,c, and it stayed in one cell. A forced wrong choice is easy to spot. We told the semicolon file to use commas, and the keys became id;name;city;amount;joined with a stray column_2, and the page reported that all 3 rows had a different number of cells. If you see that, switch the delimiter back to auto.

Quoted cells are handled the usual way. A cell with a comma, a doubled quote or a line break inside quotes comes out as one string, with \n for the line break. A byte order mark at the start of a file is dropped, so the first key is id and not an invisible character plus id. Non-Latin text such as 小明 is kept as is.

Numbers, IDs and true/false

With the type option on, plain numbers become JSON numbers and the lowercase words true and false become booleans. Everything else stays text. That rule keeps most IDs safe: 007 and 00501 stay text because of the leading zero, a 17-digit order ID stays text, and so does a 16-digit one. Dates stay text too (2025-01-03), as do European decimals such as 120,50, because the comma is not a decimal point in JSON.

There are three side effects to know about before you rely on it:

Header row, ragged rows and repeated names

Untick the header and you get a list of lists, the header line included (our 4-row file gave 5 rows). If a row has fewer cells than the header, the missing ones are null. If it has more, the extras are added under the keys column_4, column_5 and so on. Our ragged sample (a, b, c with one short row and one long row) gave "c": null in row 2 and "column_4": 9 in row 3, and the page said that 2 rows differed. A repeated header name is not overwritten: id,name,id gave the keys id, name and id_2.

A file of only blank lines produced no output and no message.

How big a file can be

The limit is 10 MB. Our 9.5 MB test file (9,894,174 bytes, 210,000 rows) converted in about 4 seconds and produced a 26,878,949 byte JSON download, 2.7 times the input, because every row repeats the keys. The box shows only the first 300 KB of the result and says so. Copy JSON and Download .json always give the whole thing, and the download parsed as valid JSON with all 210,000 items. A 10.9 MB file was refused with a message to paste the part you need. If the file is bigger, split it first or use a command-line tool.

Related conversions

For the reverse direction, with nested JSON flattened into columns, use JSON to CSV. If the source is a spreadsheet, CSV and Excel converter reads and writes .xlsx. To check or tidy the JSON you just made, open it in the JSON formatter.

Measured results

What the page produced for each test file, in headless Chromium with Papa Parse 5.4.1. Values were read from the output box and from the downloaded file.
InputSettingRowsWhat came out
Comma file, 154 bytesAuto4Delimiter: comma. amount 120.5, 99, 310.25, 0 as numbers; dates as text
Semicolon file, 124 bytesAuto3Delimiter: semicolon. amount "120,50" and date "03.01.2025" stay text
Tab file, 52 bytesAuto2Delimiter: tab
Pipe file, 58 bytesAuto2Delimiter: pipe. "a,b,c inside one field" kept whole
Comma fileNumbers off4Every value a string, amount "120.50"
IDs file, 159 bytesNumbers on3"00501", "007" and the 17-digit ID stay text; 94105 becomes a number; TRUE stays text
Ragged file, 24 bytesAuto3Row 2 has "c": null, row 3 has "column_4": 9; the page says 2 rows differed
BOM file with UTF-8Auto3Clean key id; names Émilie, Zoë and 小明 intact
9.5 MB fileAuto210,00026,878,949 byte download in about 4 s; the box shows the first 300 KB

Prefer a desktop tool?

A spreadsheet program such as LibreOffice or a scripting language such as Python is a better fit for files over 10 MB, for data you want to clean or join before converting, or for a conversion that must run every night. For a quick look at the raw CSV first, any text editor, such as Notepad++, will do.

Frequently asked questions

Is my CSV uploaded?

No. The conversion runs in your browser tab. The only download is the Papa Parse library from cdnjs on first use. In our log that request had no body, and no request carried the text we typed or the files we opened.

How do I keep leading zeros?

They are kept by default: 007 and 00501 stay text. To keep every value exactly as written, untick Turn numbers and true/false into JSON values.

Why did 120.50 become 120.5?

JSON numbers have no trailing zeros. With the type option on, 120.50 is a number, so it is written 120.5. Untick the option to keep "120.50" as text.

My file uses semicolons. Will it work?

Yes. Auto detection found the semicolon in our European sample. Decimal commas such as 120,50 stay as text, so convert them yourself if you need numbers.

What happens when rows have different numbers of cells?

Short rows get null for the missing cells, and extra cells are stored as column_4, column_5 and so on. The page tells you how many rows differed.

Can I get a list of lists instead of objects?

Yes. Untick First row is the header. The first line then becomes the first list.

How large a file can I convert?

Up to 10 MB. A 9.5 MB file with 210,000 rows took about 4 seconds. The box shows the first 300 KB, while Copy and Download give everything.

Why is the JSON so much bigger than the CSV?

Each object repeats every key. Our 9.5 MB CSV became 26.9 MB of indented JSON. Turning off Indent the JSON makes it smaller.