Convert to UTF-8

Detect a text file’s encoding and convert it to UTF-8 or another encoding, with any line endings.

Runs in your browser. Nothing is uploaded.

Updated

Text filesRuns in your browser · up to 50 files, 100 MB each
Your files stay on this device. No upload required.

How to use Convert to UTF-8

  1. Choose or drop up to 50 text files.
  2. Check the encoding found and the preview; pick another encoding if the words look wrong.
  3. Choose the new encoding and line endings, convert, and download.

Convert to UTF-8 at a glance

Typical use: Fix a CSV from old Excel that shows é instead of é, and give it Linux line endings.

Runs in your browser; nothing is uploaded. Characters the new encoding can’t hold are listed, never dropped silently.

When you need it

  • A CSV from an old program opens with é, ü or � where accents should be.
  • A database import, a website or a script wants UTF-8, but the file is in an older code page such as Windows-1252 (“ANSI”), Windows-1251 or Shift_JIS.
  • An old system wants the opposite: Windows-1252 or another single-byte encoding.
  • A file has Windows line endings (CRLF) and a Linux tool or Git complains, or the other way round.

How the encoding is detected

A text file doesn’t say which encoding it uses, so the tool works it out and tells you how sure it is. A byte-order mark (BOM) or valid UTF-8 is certain. For older encodings it reads the file in each likely one and picks the reading that looks most like real text: letters of one alphabet, sensible punctuation, no control characters.

Western and Central European code pages share most letters, so those results are marked as a guess. Check the preview: if words look wrong, choose another encoding under “Read the file as” and the preview updates.

Convert to UTF-8 example

customers.csv was saved by an old version of Excel. The tool shows Encoding found: Windows-1252 (a guess), Line endings: 120 CRLF, and the preview reads “Müller, Zoë, Café Noir” correctly. Converting to UTF-8 with LF line endings gives a file a little larger than before, because accented letters take two bytes in UTF-8.

Converting the other way, to Windows-1252, stops if the text has characters that code page doesn’t have (such as “Ł” or an emoji) and lists each one with its line and column, so nothing is lost without you knowing.

Text that was converted twice

“Café” instead of “Café” is UTF-8 text that some program read as Windows-1252 and saved as UTF-8 again. The tool notices this pattern and offers to read the file “as converted twice”, which undoes the extra step.

Prefer the terminal?

The same in a terminal with iconv, plus dos2unix or unix2dos for line endings:

iconv -f CP1252 -t UTF-8 'old.csv' | dos2unix > 'old-utf8.csv'

You have to know the source encoding: iconv doesn’t detect it. It stops at the first character the target can’t hold unless you add //TRANSLIT or -c, which drops it without telling you. It doesn’t add a BOM for UTF-8 or UTF-16. After converting, each file shows its own command.

References

Frequently asked questions

Are my files uploaded?

No. Detection and conversion run in your browser on your device; this page sends nothing to our server.

What is “ANSI”?

Windows calls its local code page “ANSI”. In Western Europe and the Americas that is Windows-1252; elsewhere it can be Windows-1250, 1251 or another. It isn’t a single encoding, which is why the tool shows its best guess and a preview.

Should I use UTF-8 with or without a BOM?

Without, for websites, code, databases and Linux tools: a BOM can show up as stray characters there. With a BOM if the file will be opened in Excel or old Windows programs, which use it to recognise UTF-8.

Can it convert to Shift_JIS, GBK or Big5?

It can read them, but it only writes Unicode (UTF-8, UTF-16) and single-byte encodings. For Chinese, Japanese and Korean text, UTF-8 is what almost every program expects today.

What happens to bytes that aren’t valid in the source encoding?

They become the replacement character � and the tool tells you how many there are and where the first one is. Nothing is dropped silently. Many of them usually means the wrong source encoding was chosen.

How large can the files be?

Up to 50 files at a time, 100 MB each.