To show file extensions in Windows 11, open File Explorer (Windows key + E) and select View > Show > File name extensions, so that it has a check mark. Files then appear with their full names, such as report.pdf or setup.exe, in every folder for your user account.
That is the path Microsoft's support page gives for Windows 11. Below are two other ways to do the same thing, how to check the current setting without clicking through menus, and why it matters for spotting disguised malware.
Method 1: File Explorer's View menu
- Open File Explorer: press Windows key + E, or type
file explorerin the taskbar search box and select it. - In the toolbar, select View.
- Point to Show, then select File name extensions.
A check mark next to File name extensions means extensions are visible. Select it again to hide them. The setting applies to every folder for your account, not just the current one.
On Windows 10 the ribbon looks different: Microsoft's instructions there are View tab, Show/hide group, then tick the File name extensions check box.
Method 2: Folder Options
The older dialog holds the same setting, worded the other way round.
- Press Windows key + R, type
control.exe foldersand press Enter. Microsoft documents this as the command that "Launches the Folder Options window". - Select the View tab.
- In the list of settings, clear the check box Hide extensions for known file types.
- Select OK.
This is the same switch as Method 1. Ticking one updates the other.
Method 3: Windows Settings
Recent Windows 11 builds also put the toggle in Settings. Microsoft's documentation for the Advanced settings page lists a File Explorer group with Show file extensions, alongside Show hidden and system files and Show full path in title bar.
- Open Settings (Windows key + I).
- Go to System > Advanced. On older builds the page is called For developers; Microsoft says that "In Windows 11, version 25H2 and later, the former For developers settings are now surfaced under the Advanced page."
- Expand File Explorer and turn on Show file extensions.
If the toggle is greyed out on a work or school PC, Microsoft notes that "Devices managed by an organization may apply policies that disable Advanced settings toggles." Methods 1 and 2 may still work, unless your IT department enforces the setting another way.
Check the setting without opening any menus
All three methods write one registry value for your user account: HideFileExt under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced. 1 means extensions are hidden and 0 means they are shown. Reading it is harmless. In PowerShell:
Get-ItemPropertyValue -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name HideFileExt
Or in Command Prompt:
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt
Example output on a Windows 11 23H2 PC with extensions shown:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
HideFileExt REG_DWORD 0x0
Windows also stores the definition of the Folder Options checkbox itself in the registry. On the same PC, the metadata under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\HideFileExt reads CheckedValue 1, UncheckedValue 0 and DefaultValue 1. That last one is why a new Windows account starts with extensions hidden.
To change the setting, use one of the three methods above rather than editing the registry by hand. Reading the value is safe; writing it is unnecessary.
Why you should turn file extensions on
With extensions hidden, Windows shows invoice.pdf.exe as invoice.pdf. The final .exe is what counts: it's a program, and opening it runs it. MITRE ATT&CK lists this trick as technique T1036.007, Masquerading: Double File Extension, with the example that "File.txt.exe may render in some views as just File.txt". Its first listed mitigation is turning off the default to hide extensions for known file types.
Some extensions that should make you stop before opening an email attachment or download:
| Extension | What it is | What opening it does |
|---|---|---|
.exe, .scr, .com | Programs (.scr is a screen saver, which is also a program) | Runs code with your permissions |
.msi | Windows Installer package | Installs software |
.bat, .cmd, .ps1, .vbs, .js | Scripts | Runs commands |
.lnk | Shortcut | Can launch any command, whatever its icon looks like |
.iso, .img | Disk images | Mounts as a drive that can contain any of the above |
.docm, .xlsm | Office files with macros | Can run macro code if you enable it |
An icon proves nothing, since a program can carry any icon it likes. Trust the extension, and see how to spot phishing for the other warning signs that usually come with these files. Types of malware covers what they tend to install.
Other places that always show extensions
Command-line tools ignore the File Explorer setting. In PowerShell, list files with their extensions as a separate column:
Get-ChildItem C:\Windows\System32\notepad.exe | Select-Object Name, Extension
Real output:
Name Extension
---- ---------
notepad.exe .exe
In Command Prompt, dir always prints full file names. For more everyday commands, see PowerShell commands for beginners.
If the setting keeps turning itself off
The value lives in your user profile, so it doesn't reset on its own. If it does, something is writing it back: on a managed PC that's usually a Group Policy or device-management profile (Microsoft's archived Group Policy template for HideFileExt shows how organisations set it), and on a personal PC it can be a "tweak" or cleanup utility. Check with the registry query above after a restart to see whether the value has changed back to 1.
Frequently asked questions
- Why does Windows hide file extensions by default?
- Windows hides extensions only for file types it recognises, and the setting has defaulted to hidden for many versions. The registry metadata for the 'Hide extensions for known file types' checkbox lists its default value as 1, which means hidden. Microsoft doesn't give a reason on its support page; the effect is shorter names, at the cost of hiding what kind of file you are about to open.
- Does showing file extensions change anything for other users?
- No. The setting is stored per user, under HKEY_CURRENT_USER, so turning it on for your account doesn't change what other accounts on the same PC see.
- I turned on file extensions but some files still show none. Why?
- Those files genuinely have no extension, which is common for files downloaded from some web apps or copied from Linux and macOS. Windows then doesn't know which program to open them with. If you know the real type, rename the file and add the correct extension.
- Is it safe to change a file's extension?
- Renaming the extension doesn't convert the file; it only changes which program Windows uses to open it. Renaming report.docx to report.pdf leaves a Word file that PDF readers can't open. Use the program's Save As or Export option to convert formats, and only rename an extension when it was wrong in the first place.
Sources
- Microsoft Support: Common file name extensions in Windows
- Microsoft Learn: Advanced Windows Settings (formerly For developers)
- Microsoft Learn: Executing Control Panel Items (control.exe folders)
- Microsoft Learn (archived blog): Group Policy template for Hide File Extensions, HideFileExt
- MITRE ATT&CK T1036.007: Masquerading: Double File Extension