CSV encoding helper
Drop a garbled CSV — see its real encoding, download one Excel opens.
Drop a CSV here
or click to choose — .csv / .tsv / .txt, up to 5.0 MB. Read in this tab, never uploaded.
Export
How to use it
- Drop a CSV onto the card, or click “Choose file”. The encoding and the delimiter are detected immediately and the table appears below — there is no button to press. The line under “What this file is” tells you which encoding was used and how many other candidates would have decoded the file just as cleanly.
- If the preview is still wrong, pick the source encoding by hand. The list follows the language of this page: Chinese pages lead with GB18030 and Big5, Arabic pages with Windows-1256 and ISO-8859-6, English pages with Windows-1252 and MacRoman. Switching is instant and never touches the file you opened.
- Press “Download CSV” for the repaired copy. It is always UTF-8; ticking “Add BOM” (on by default) puts the three-byte mark at the front so Excel stops falling back to the system code page. “Copy” gives you the same text without that mark, ready for a database or a script.
- Pasted text is the second input, for the case where the garbled characters were already saved into a file as text. There are no original bytes left at that point, so nothing can be detected — but ticking “Repair garbled characters” writes the text back to bytes as Windows-1252 and reads it as UTF-8, which restores “Café” to “Café”.
Example
Sample file (Windows-1252 bytes)
name,city,note,amount Café,Müller,"rush order, please",89.90 Crème Brûlée,Lyon,"merci" – ok,15.50
Downloaded file (UTF-8 with BOM)
name,city,note,amount Café,Müller,"rush order, please",89.90 Crème Brûlée,Lyon,"merci" – ok,15.50
The sample is a Windows-1252 file, the export is UTF-8 — the characters are the same, the bytes are not. What changes for Excel is the three-byte mark at the front.
Limits
- Export is UTF-8 only (with or without a BOM). The platform TextEncoder implements UTF-8 and nothing else, so building a code-page table by hand could not be verified byte for byte against iconv or Excel — claiming “converted to GBK” would be a false precision. To write a legacy code page, confirm the encoding here first, then run iconv -f <source> -t GBK on your machine.
- A legacy code page is always reported as a guess, never as certain. GBK and Big5, or Windows-1252 and MacRoman, are interchangeable on short samples, so the tool lists the tied candidates and lets you confirm from the preview in one click.
- A few GBK and Big5 byte sequences happen to be valid UTF-8 as well (C2 80 is the character 聙 in GB18030 and a control character in UTF-8). Those are downgraded to a guess and the candidates are listed rather than silently trusted.
- The candidate set is what the browser TextDecoder supports. CP437, TIS-620 and hp-roman8 are not included, and UTF-32 cannot be decoded at all — a UTF-32 byte-order mark is reported and then refused.
- Pasted text carries no bytes. It can be repaired if the garbled characters survived, but text that already contains ? or the replacement character has lost information for good and is never silently “fixed”.
- The preview renders the first 200 rows and truncates long cells; the download is the whole table with full values. Nothing is trimmed, re-typed or de-duplicated — leading zeros, dates that look like numbers and quoted commas all stay exactly as they were.
- Files above 5 MB and text above 200,000 code points are refused with a message rather than truncated. .xls and .xlsx are binary containers and are not read.
- Everything runs in this tab: no upload, nothing written to the address bar, nothing stored. To check, turn off your network after the page loads — the tool keeps working.
Related tools
Neighbouring steps on the same file: read it, tidy it, reshape it.