logo
search
Others

How to Fix Notepad Displaying Code Instead of Normal Text

Elise WilliamsElise Williams Oct 22, 2026 869 views

Question details

Users report that files opened in Notepad show unreadable code or gibberish instead of standard text characters.

How to Fix Notepad Displaying Code Instead of Normal Text
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.
Before you start

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.

Solution 1Recommended

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.

1
Show File Extensions

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.

2
Inspect the Format

Check if the file ends in an extension other than .txt (such as .docx or .pdf).

3
Open with the Correct Application

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).

Verify and Correct the File Extension
Correct Association: Assigning the correct default application to a file type prevents it from accidentally opening in Notepad in the future.
Free Microsoft Office alternative

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. 1. Install WPS Office: Download and install the free WPS Office suite for Windows from the official website.
  2. 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. 3. Edit Seamlessly: View and edit your rich-text documents with proper formatting restored.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx)Built-in PDF reader and editor to seamlessly handle rich text filesFamiliar, intuitive interface for an effortless transition from other office suites
microsoft office alternative - wps office

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.