How to Fix Notepad Displaying Code Instead of Normal Text
Question details
Users report that files opened in Notepad show unreadable code or gibberish instead of standard text characters.

- Product
- Windows Notepad
- Device & OS
- Windows
- Scenario
- Attempting to open a file in Notepad to view or edit its contents.
- Observed behavior
- The file displays incompatible encoding, raw binary data, or strange characters instead of the expected plain text.
Verify that the file you are trying to open is actually a plain text document, as opening rich-text files (like Word documents or PDFs) in a basic text editor will inherently display raw, unreadable code.
Verify and Correct the File Extension
Ensures the file is a true plain text format and not a complex document incorrectly associated with Notepad.
Notepad is a standalone Windows application designed specifically for plain text (.txt) files. It is not part of Microsoft Office and cannot render complex formatting. If you open files like .docx, .pdf, or .rtf in Notepad, they will display as gibberish.
Open File Explorer, click the 'View' tab at the top of the window, and check the box for 'File name extensions' to reveal the true format of your file.
Check if the file ends in an extension other than .txt (such as .docx or .pdf).
If it is not a .txt file, right-click the file, hover over 'Open with', and choose the appropriate application for that file type (e.g., a word processor or PDF reader).

Adjust the Text Encoding Format
Fixes unreadable characters caused by incorrect character encoding such as ANSI or UTF-8 mismatches.
Restore a Previous Version of the File
Recovers readable text if the current file has been corrupted or damaged.
Open Complex Documents Without Errors Using WPS Office
If your file is actually a Word document, spreadsheet, or PDF displaying as unreadable code in Notepad, WPS Office provides a free, lightweight, and highly compatible solution to open, view, and edit it correctly.
- 1. Install WPS Office: Download and install the free WPS Office suite for Windows from the official website.
- 2. Open the File: Right-click the file that was displaying as code in Notepad, select 'Open with', and choose WPS Office from the application list.
- 3. Edit Seamlessly: View and edit your rich-text documents with proper formatting restored.

Frequently Asked Questions
Why does a Word document display gibberish when opened in Notepad?
Notepad is a basic text editor designed only for plain text. It cannot process the complex XML formatting, images, and metadata embedded in Microsoft Word (.docx) files. When forced to open them, it displays the file's raw binary data as unreadable characters.
How can I change the default app for opening text files back to Notepad?
Right-click any .txt file, go to 'Open with', and select 'Choose another app'. Find Notepad in the list, check the box for 'Always use this app to open .txt files', and click OK.
Can I recover a corrupted text file if there are no previous versions available?
If a file is heavily corrupted and Windows File History has not saved any previous versions, the original data might be lost. You can try opening it in a more advanced text editor or a specialized recovery tool to see if any partial text can be salvaged, but success is not guaranteed.




