How to Change the Default Character Encoding in Notepad

This post explains how to change the default character encoding in Notepad (e.g., UTF-8 to ANSI) on Windows 10.

ANSI has been the default encoding in Notepad in earlier versions of Windows 10. Since Windows 10 version 1903, the default Notepad encoding is UTF-8.

When you launch notepad.exe, the default encoding is shown in Notepad’s status bar in Windows 10 v1903 and higher.

notepad default character encoding windows 10

When saving a file in Notepad in any version of Windows 10, you can choose one of these character encoding types:

  • ANSI
  • UTF-16 LE
  • UTF-16 LE
  • UTF-8 (default)
  • UTF-8 with BOM
notepad default character encoding windows 10
(Refer to Character encodings at w3.org.)

UTF-8 is preferred if you want to use Unicode characters like Č, Ć, Š, ä, ö, ü, ß in your text file. Some of these accented characters will be lost if you save the file as ANSI. Notepad also warns you when you do so:

This file contains characters in Unicode format which will be lost if you save this file as an ANSI encoded text file. To keep the Unicode information, click Cancel below and then select one of the Unicode options from the Encoding drop down list. Continue?

notepad ansi warning unicode

Some users need ANSI to be the default

There are users who want to change Notepad’s default encoding from UTF-8 to ANSI. For example, VBS/WSH script coders may want ANSI as the default – because CScript.exe or WScript.exe can’t run UTF-8 encoded .vbs files.

Let’s see how to change Notepad’s default encoding to ANSI or another encoding in Windows 10.

Change the Default Character Encoding in Notepad

To set the default encoding in Notepad, you can use the Registry Editor.

  1. Right-click Start, click Run. Type regedit.exe and click OK.
  2. Go to the following registry branch:
    HKEY_CURRENT_USER\Software\Microsoft\Notepad
  3. From the Edit menu, click New → DWORD (32-bit) value
  4. Name the value as iDefaultEncoding
  5. Double-click iDefaultEncoding and set its data to 1 (for ANSI).
    notepad default character encoding windows 10 registry
    Here is the list of possible value data you can assign:
    1 = ANSI
    2 = UTF-16 LE
    3 = UTF-16 BE
    4 = UTF-8 BOM
    5 = UTF-8
    
  6. Exit the Registry Editor.
  7. Open a new instance of Notepad. You’ll see that the default encoding has changed to ANSI — which is reflected in the status bar.

Note that the above registry setting applies only when you open a new Notepad instance by running Notepad.exe. If you open a text document previously saved in a different encoding, Notepad will open the file in the encoding specified in that file.



Despite the above registry modification, when you use the Desktop New menu (New → Text document), the New Text Document.txt fill will use UTF-8 anyway.

notepad default character encoding windows 10 - shellnew

There is no workaround for that in Windows 10.


Force UTF-8 as default for New Text Documents (older versions of Windows)

This is the opposite of the earlier method – changing the New Text Document’s default encoding to UTF-8 from ANSI. This method is for older (than v1903) versions of Windows 10 and earlier Windows OS.

Clicking on Desktop → New → Text Document uses ANSI in earlier versions of Windows. However, using the template file method, we can force Windows to create the New Text Document in UTF-8. Follow these steps:

  1. Open Notepad as administrator.
  2. From the File menu, click Save.
  3. Choose UTF-8 encoding from the dropdown list.
  4. Save the file as template.txt in C:\Windows\ShellNew.
  5. Close Notepad.
  6. Launch the Registry Editor (regedit.exe)
  7. Go to the following branch:
    HKEY_CLASSES_ROOT\.txt\ShellNew
  8. Create a new String (REG_SZ) value named FileName
  9. Double-click FileName and set its data to:
    template.txt

    notepad default character encoding windows 10 - shellnew

  10. Exit the Registry Editor.

We’ve now created an UTF8-encoded template file and referenced it in the registry. Windows will use it when you create a new text document.

  • Right-click desktop → click New → Text Document.
  • Double-click the newly created document.

If the above steps were executed correctly, you should see UTF-8 in the Notepad status bar.

[Note that the reverse (UTF-8 to ANSI) is not possible using the template method, as Notepad will open an ANSI-encoded file in UTF-8 mode anyway. You may look for Notepad alternatives in that case.]


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support, my reader. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment