Why you need to see filename extensions
By default, Windows hides the three or four letters at the end of a filename — the part that tells your computer what kind of file it is. A file called budget.xlsx appears as just budget. This matters because a file that looks like a photo could actually be a program, a script, or something that will damage your computer when you open it.
Attackers use this to their advantage. They send you a file that looks like invoice but is actually invoice.exe — an executable program. Without seeing the extension, you cannot tell the difference. Showing extensions takes two minutes and gives you a real safety layer: you will see when ready when something is not what it claims to be.
This is especially important if you read files from email, messaging apps, or websites. The extension is your first line of defense against opening something dangerous by accident.
Key Takeaways
- File extensions are the letters after the dot in a filename, and they tell your computer what kind of file it is — hiding them makes it easier to open dangerous files by mistake.
- On Windows, you turn on extensions in File Explorer by clicking the View tab and checking "File name extensions".
- On Mac, open Finder, go to Preferences, click Advanced, and check "Show all filename extensions".
- Once extensions are visible, be suspicious of files that claim to be one thing but have an extension like .exe, .bat, .scr, or .msi.
How to show extensions on Windows
Open File Explorer — the folder icon on your taskbar or in your Start menu. At the top, click the View tab. In the ribbon that appears, look for a checkbox labeled File name extensions and click it. That is all. From now on, every file will show its full name, including the extension.
If you do not see a View tab, you may be in a different view mode. Look for a button that looks like three horizontal lines (the menu button) in the top right corner of File Explorer. Click it and select Options, then go to the View tab in the window that opens. Scroll down until you find Hide extensions for known file types and uncheck it.
Once this is done, the setting stays on. Every folder you open will show extensions from that point forward.
How to show extensions on Mac
Open Finder — the blue and white face icon in your dock. In the menu bar at the very top of your screen, click Finder, then select Preferences. Click the Advanced tab. Check the box next to Show all filename extensions. Close the window. You are done.
On newer versions of macOS, the setting may be labeled slightly differently, but it will be in the same Finder Preferences window under Advanced. Once you check it, all files in Finder will display their extensions.
What extensions mean and which ones to watch for
Common file extensions tell you what a file contains. .pdf is a document, .jpg or .png is a photo, .docx is a Word document, .xlsx is a spreadsheet. These are safe to open from trusted sources.
Be very cautious with these extensions, especially if they arrive unexpectedly in email or a message:
- .exe — a Windows program or process
- .bat — a batch file that runs commands on your computer
- .scr — a screensaver, often used to hide malware
- .msi — a Windows installer
- .zip — a compressed folder that could contain any of the above
- .app — a Mac process
- .dmg — a Mac disk image, similar to an installer
If someone sends you a file that claims to be a photo or document but ends in .exe or .bat, do not open it. This is one of the most common ways malware spreads. When in doubt, ask the person who sent it whether they meant to send that file type.
Double extensions and disguised files
Attackers sometimes use a trick called a double extension. A file might be named photo.jpg.exe. Your eye catches the .jpg and assumes it is a photo, but the actual extension is .exe. With filename extensions turned on, you will see the full name and catch this when ready.
Another trick is to use a file type that looks like a document but is actually a program. For example, .scr files are screensavers but can contain malware. They do not look as obviously dangerous as .exe, but they behave the same way. Once extensions are visible, you will see what you are actually opening.
What to do if you accidentally open a suspicious file
If you open a file and your computer suddenly starts acting strange — programs opening on their own, your cursor moving without you touching it, or windows popping up — disconnect from the internet when ready and restart your computer in Safe Mode. This stops most malware from running while you restart.
On Windows, restart and hold down the Shift key while clicking the power button to shut down. Then turn the computer back on and hold F8 or Shift+F8 repeatedly until you see the boot menu. Select Safe Mode with Networking. On Mac, restart and hold Command+S to enter Safe Mode.
Once in Safe Mode, run a full scan with your antivirus software — Windows Defender (built into Windows) or a program like Malwarebytes. If you are not sure whether something is wrong, ask someone with technical knowledge before opening the file again.
Frequently Asked Questions
Will showing extensions break anything or make my computer slower?
No. Showing extensions is purely a display setting. It does not change how your computer works or how files are stored. It only changes what you see on your screen. You can turn it off anytime if you prefer the old view.
What if a file has no extension at all?
Files without extensions are unusual on Windows and Mac. If you receive one, be extra cautious — it may be intentionally hidden. Ask the sender what type of file it is before opening it. On Mac, files without extensions are more common, but you can still right-click and select "Get Info" to see what kind of file it is.
Can I change a file's extension to disguise what it is?
You can rename a file and change its extension, but the file itself does not change. Renaming an .exe file to .txt does not make it a text file — it is still a program. Your computer may refuse to open it or open it with the wrong program. This is why seeing the real extension matters: it shows you what the file actually is, not what someone named it.
Is it safe to open files with extensions like .docx or .pdf?
These file types are generally safe, but safety depends on the source. A .pdf from your bank is safe. A .pdf from an unknown sender that asks you to click a link or enable macros should be treated with suspicion. The extension tells you the file type, but you still need to think about where it came from.