Convert CSV to JSON

Runs on your device · Your file never leaves your device.

Drop a .csv export or paste the text and get a JSON list — one object per row, with the header row as the keys. The parser follows RFC 4180, so quoted fields, doubled quotes, and commas or line breaks inside a cell all survive intact.

The column separator is detected automatically among comma, semicolon, tab and pipe — European exports that use semicolons work without any setting — and you can override it. By default "12" becomes the number 12, "true" becomes a boolean and an empty cell becomes null — but only where nothing changes: 1.50, 1e3, 007 and long IDs stay text, because as numbers they would be written back differently. Switch it off and every value stays exactly the text it was.

Duplicate or blank header names are given unique names (column_3), a byte-order mark is stripped, a file saved as UTF-16 or in an older code page is read as such and named, rows with more cells than the header are reported with their line, and a parse problem is reported with its line and column rather than as a vague message. The preview shows the first 200 lines before you download.

How to convert CSV to JSON

  1. Drop a CSV file, or paste the CSV text into the box.
  2. Leave the separator on automatic, or choose it; decide whether numbers and booleans should be typed.
  3. Press Convert to JSON and check the preview.
  4. Download the .json.

Supported formats and limits

Input
CSV / TSV (.csv, .tsv, .txt) — a file or pasted text
Output
JSON array of objects, pretty-printed, UTF-8
Parsing
RFC 4180: quotes, embedded separators and line breaks
Separator
Auto-detected: comma, semicolon, tab, pipe
Where it runs
In your browser; nothing uploaded

Not for: Rebuilding nested structures — a CSV is flat, so every row becomes a flat object; dot-named columns are not re-nested.

Exactly what type detection changes

With the switch on, a cell becomes a number only when the number would be written back as the same text: 12, -4 and 3.5 become numbers. 1.50, 1e3 and -0 stay text, because as numbers they would come back as 1.5, 1000 and 0. So do 007, +5, " 12", 3,5, 1,250, a percent or currency sign, and an ID longer than a number can hold exactly.

true and false are recognised in any capitals, so TRUE becomes true. An empty cell becomes null, but the word NULL stays text, since it can also be a value or a name. Dates such as 2024-01-05 always stay text.

Rows that are shorter or longer than the header

Cells are matched to the header by position. A row with fewer cells gets null for the missing columns (an empty string with detection off). A row with more cells than the header has nowhere to put the extra ones, so they are left out, and a message above the preview says how many rows this happened to and on which line the first one starts. It usually means a value such as Smith, John holds the separator without quotes.

Blank lines are skipped. Header names are trimmed of surrounding spaces; values are not, so " Cairo" keeps its space.

How quotes are read, and what an error points to

A quote starts a quoted field only as the first character of a field; in the middle, as in 5" screen, it stays part of the text. A quote that opens a field and is never closed would pull the rest of the file into one cell, so the conversion stops and gives the line and column where that quote opened.

Separator detection and the file's encoding

Detection looks at the first 64 KB, up to 50 lines, and picks the separator that gives the same number of columns on the most lines; separators inside quotes are not counted. In a semicolon file with decimal commas, such as A;1,5, the semicolon is found and 1,5 stays text.

The file is read by what its bytes are: a byte-order mark, UTF-16 (which Excel writes as "Unicode Text"), or UTF-8. When the bytes are not valid UTF-8, the older code page that makes them read as words is used: the Windows code pages for Western and Central European, Cyrillic, Greek, Turkish, Hebrew, Arabic (with Persian and Urdu) and Thai text, or GB18030, Big5, Shift_JIS and EUC-KR for Chinese, Japanese and Korean. The file line then says so, for example "read as windows-1256, not UTF-8"; a very short file has few letters to judge by, so check its preview.

Frequently asked questions

Are my files uploaded to a server?
No. This conversion runs inside your browser using your own device’s processing power, and the file is not uploaded. Once a tool has been used once (video, text recognition and background removal download their engine from this site the first time), it keeps working when your connection drops.
How are numbers, booleans and empty cells handled?
With "Detect numbers, booleans and empty cells" on, 12 and 3.5 become numbers, true/false become booleans and an empty cell becomes null. A value becomes a number only when it would be written back exactly the same, so 1.50, 1e3, leading zeros (007) and long IDs stay text and nothing is silently changed. Turn the switch off to keep every value as text.
My file uses semicolons or tabs — do I need to do anything?
No. The separator is detected from the first lines of the file. If the guess is wrong, choose the separator explicitly from the list.
What if a cell contains a comma or a line break?
That is what quoting is for, and the parser handles it exactly as the standard says: a field wrapped in quotes may contain separators, line breaks and doubled quotes.

Related tools

More in Spreadsheets & data

This page in other languages: العربية · Deutsch · Français · Español · Русский · Português · 中文 · हिन्दी · Türkçe · עברית · فارسی · اردو · Bahasa Indonesia · বাংলা