Fix character encoding in Notepad++

Notepad++ shows é instead of é, or small black boxes like xE9? Then the chosen encoding doesn’t match the file. Two menu items usually fix it – if you know which one you need.

Works with text and these files:

  • CSV
  • TXT
  • JSON
  • XML
  • SRT
  • VTT
  • TSV
  • MD
  • HTML
  • SQL
  • LOG

For example Excel exports, database dumps, subtitles or website code.

Repair

  1. Drop a file or paste text
  2. It gets repaired automatically
  3. Copy or download
or simply drag a file here

First, check the encoding

At the bottom right of the status bar, Notepad++ shows how it currently reads the file, such as UTF-8, UTF-8-BOM or ANSI. The Encoding menu has two kinds of entries that are often confused:

  • ANSI, UTF-8, UTF-8-BOM (top of the menu): Notepad++ re-reads the existing bytes without changing the file – a display setting only.
  • Convert to ANSI, Convert to UTF-8 … (bottom of the menu): Notepad++ writes the characters in the new encoding. Saving changes the file.

Case 1: é instead of é

The file is saved as UTF-8, but Notepad++ reads it as ANSI. Choose Encoding → UTF-8, and the characters appear correctly right away. Don’t convert: “Convert to UTF-8” would save the garbage é as real characters.

Case 2: xE9 or boxes instead of é

The file is saved in ANSI (Windows-1252) but read as UTF-8. First choose Encoding → ANSI so the characters appear correctly, then Convert to UTF-8. After saving, the file is UTF-8.

Case 3: the garbage is really in the file

If Notepad++ still shows é with UTF-8 selected, the broken text has already been saved. Then no menu item helps reliably – especially not when correct and broken lines are mixed or the text is double-encoded. Drop the file into Mojibuster above: it repairs only the broken spots and shows you every change.

A file in which the error has already been saved

Before

Translation checked: café, naïve, résumé, Zürich – all correct.

After

Translation checked: café, naïve, résumé, Zürich – all correct.

Always create new files as UTF-8

Under Settings → Preferences → New Document, set the encoding for new files to UTF-8. For files Excel should open, UTF-8-BOM is the better choice – more on Excel showing special characters wrong. Scripts for Windows PowerShell 5.1 need a BOM too, see PowerShell.

Frequently asked questions

What’s the difference between UTF-8 and UTF-8-BOM?

Both store the characters the same way. UTF-8-BOM additionally writes three invisible bytes at the start, from which Excel and older programs recognize UTF-8.

Why does Notepad++ sometimes detect the encoding wrongly?

Files without a BOM contain no information about their encoding, so Notepad++ has to guess. With short files and few special characters, it’s wrong more often.

Can I convert several files at once?

In Notepad++ only with macros or plugins. In Mojibuster it’s one file after another – each one is done in seconds.

More guides