How file extensions work on Windows (and why to show them)
Windows hides file extensions by default. What the characters after the last dot do, how to switch them back on, and the trick that hiding them enables.
Written by the team building Quick File Organizer, folders that organize themselves, by your rules.
Windows hides file extensions by default, and has done for nearly thirty years. It is a small setting with a long shadow: it explains why a file you renamed still opens in the wrong app, why two files in a folder appear to have identical names, and why one of the oldest tricks for disguising a program as a document still works.
Here is what file extensions actually are, and why the first thing to do on a new PC is switch them back on.
What an extension actually is
There is no hidden field on the file holding its type. The extension is part of the name, and Windows reads the part after the last dot.
Two consequences follow, and both surprise people:
- Renaming does not convert. Changing
photo.pngtophoto.pdfproduces a PNG with a misleading name. The bytes are untouched; the PDF reader will simply fail to open it. - Nothing verifies the label. A file called
report.docxcan contain anything at all. The extension is a claim about the contents, and claims can be wrong — by accident or on purpose.
Why Windows hides file extensions by default
The setting dates from a time when file names were considered intimidating, and
the reasoning was that Holiday photo reads better than Holiday photo.jpg.
For someone who never renames anything, that is defensible.
The cost is that you can no longer see what a file is. Two files called
Invoice in the same folder are, as far as Explorer shows you, the same thing
— one might be a spreadsheet and one a program. Sorting by the Type column
helps, but it is a column you have to look at, and it does not travel with the
file when someone sends it to you in a chat window.
How to show file extensions
Open File Explorer
Windows key + E, or any folder.
Windows 11: View → Show → File name extensions
The View button is in the toolbar along the top. Tick the entry and it applies everywhere at once.
Windows 10: the View tab → File name extensions
Same setting, older layout — a checkbox on the ribbon's View tab.
It takes about four seconds and it is permanent. There is no downside worth weighing against being able to see what you are opening.
The trick that hiding them enables
This is the part that matters. Windows reads the last extension, but with extensions hidden it displays the name with that last one removed.
A file named invoice.pdf.exe appears in Explorer as invoice.pdf. It is a
program. Double-clicking it does not open a document reader — it runs code.
Worse, an executable chooses its own icon, so it can carry a document icon that matches the lie. Every visual cue agrees with the disguise, and the single cue that would give it away is the one Windows has turned off for you.
With extensions visible, the same file reads invoice.pdf.exe and the problem
announces itself.
Extensions decide which app opens the file
The association is a lookup, not a property of the document: Windows keeps a
table mapping each extension to a program. Change the default for .pdf and
every PDF on the machine opens somewhere new, without a single file being
modified.
To change it for one file, right-click → Open with → Choose another app. To change it for all of them, tick "Always use this app", or set it in Settings → Apps → Default apps.
This is also why "my files all turned into the wrong icon" is almost never a problem with the files. An association broke; the documents are fine.
Why this matters for keeping folders tidy
Once extensions are visible, they become the most reliable thing to sort by — more reliable than filenames, which people type inconsistently, and available instantly, unlike reading each file.
That is exactly what rule-based organizers match on.
Quick File Organizer watches a folder and
routes what lands in it by extension: .pdf to one place, .jpg to another,
installers somewhere you will remember to clear out. Rules are assigned per
folder, so Downloads can have a different policy from Desktop, and a preview
shows what a rule will do before anything moves.
It is worth pairing with the naming side of the job — there is a method for that in how to batch rename files on Windows.
Common questions
Are file extensions case sensitive?
No. .JPG and .jpg are the same to Windows. Keeping them lowercase is a
convention rather than a requirement, though it makes sorted lists easier to
scan.
Can a file have no extension?
Yes, and Windows will not know what to do with it — you will get the "How do you want to open this file?" prompt every time. Files arriving from macOS or Linux sometimes have none.
Does changing the extension change the file?
No. It changes the name and therefore which app tries to open it. The contents are identical, which is why a renamed file usually fails to open rather than converting. Real conversion means rewriting the data into another format.
Why do I see two files with the same name?
Almost always because extensions are hidden and the two differ only there —
budget.xlsx and budget.pdf both display as budget. Switching extensions
on resolves it instantly.
Is it safe to show file extensions?
Yes, and it is safer than hiding them. The setting only changes what Explorer displays; no file is altered. Every security guide recommends turning it on for exactly the reason above.
What are the extensions worth being cautious with?
Anything that runs rather than opens: .exe, .msi, .bat, .cmd, .scr,
.vbs, .ps1, .js. Receiving one you did not expect is worth a second
look regardless of who appears to have sent it.
Can I sort a folder by extension?
Yes — switch File Explorer to Details view and click the Type column. If you want files to be filed by type rather than merely listed that way, that needs something watching the folder; see how to save downloads to different folders by file type.