Why you need to see file extensions

By default, Windows and Mac hide the letters after the final dot in a filename — the part that tells you what kind of file it is. A file called Resume.docx appears as just "Resume". This matters because malware often disguises itself by using a fake extension or by hiding the real one. A file that looks like Resume.pdf might actually be Resume.pdf.exe — an executable program that will run code on your computer the moment you open it.

Showing extensions takes 30 seconds and gives you a real layer of protection. You'll spot when something is off — like a photo file that's actually an .exe, or a document that's a .scr (screensaver, often malicious). It's one of the easiest security habits you can build.

Key Takeaways

  • File extensions are hidden by default on Windows and Mac, which makes it easy to miss when a file is not what it claims to be.
  • Malware often uses double extensions or hides the real extension to trick you into opening dangerous files.
  • On Windows, you turn on extensions in File Explorer's View tab; on Mac, you use the Finder's preferences or right-click menu.
  • Once extensions are visible, treat any file with an unexpected extension — especially .exe, .scr, .bat, or .vbs — as suspicious.

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. Look for a checkbox labeled File name extensions and click it. That's it — from now on, every file will show its full name including the extension.

If you're using an older version of Windows, the View tab might look different. Look instead for Folder Options in the Tools menu, then click the View tab inside that window. Scroll down until you find Hide extensions for known file types and uncheck it.

Once extensions are on, they stay on. You won't have to repeat this step.

How to show extensions on Mac

Open Finder (the blue and white face icon in your dock). Click Finder in the top menu bar, then select Settings (or Preferences on older versions). Click the Advanced tab. Check the box next to Show all filename extensions. Close the window.

Alternatively, you can right-click any individual file and select Get Info. Near the bottom, uncheck Hide extension. This shows the extension for just that one file, but using the Finder setting is faster if you want to see all extensions everywhere.

What to watch for once extensions are visible

Now that you can see extensions, learn which ones are risky. Executable files — .exe, .bat, .scr, .vbs, .com, .pif — will run code the moment you open them. If you receive an email with an attachment that has one of these extensions, do not open it unless you expected it and trust the sender completely.

Double extensions are a red flag. A file named Invoice.pdf.exe is actually an executable, not a PDF. The .exe at the end is what matters. Scammers count on you seeing only "Invoice.pdf" and assuming it's safe.

Be cautious with .zip files from unknown sources. When you unzip them, the files inside might have dangerous extensions. Open the folder and check what's actually in there before running anything.

Extensions for files you download

Common safe extensions include .pdf, .docx, .xlsx, .jpg, .png, .mp4, and .txt. These are document, image, and video formats that don't execute code just by opening them. They're still worth checking — a .pdf file can contain links or embedded objects — but they're far less dangerous than executables.

If you download a file and its extension doesn't match what you expected, stop. If someone sent you a "photo" but it's a .exe file, that's a scam. If your email says you have a "voicemail" but the attachment is a .zip, that's suspicious. Trust the extension, not the filename or the story in the email.

What happens if you accidentally open a dangerous file

If you double-click a .exe or .bat file by mistake, your antivirus software should catch it before it runs — assuming you have real-time protection turned on. Windows Defender (built into Windows) and most third-party antivirus programs do this automatically. You'll usually see a warning popup before anything executes.

If you're worried you've opened something dangerous, disconnect from the internet immediately, restart your computer in Safe Mode, and run a full antivirus scan. Safe Mode loads only essential programs and makes it easier for antivirus software to find and remove threats. On Windows, restart and press F8 or Shift+F8 during startup. On Mac, restart and hold Shift.

Frequently Asked Questions

Can I change a file's extension to hide what it really is?

Yes, but it won't change what the file actually does. Renaming a .exe file to .txt doesn't make it safe — it's still executable code. Windows will warn you if you try to open it. Changing extensions is mostly useful for organizing files you already trust, not for security.

Why do some files still not show extensions even after I turn them on?

Some system files are protected and won't display extensions no matter what. This is intentional — Windows and Mac hide them to prevent accidental deletion. If a regular file isn't showing its extension, make sure you clicked the right setting and that it actually saved.

Is it safe to open a .pdf file from an unknown sender?

PDFs are safer than executables, but not risk-free. They can contain malicious links or embedded code. Don't click links inside PDFs from strangers, and keep your PDF reader updated. If you weren't expecting the file, ask the sender to confirm they sent it before opening it.

What should I do if I see a file with an extension I don't recognize?

Search the extension online — for example, ".scr" or ".vbs" — to learn what it does. If it's an executable or script format, treat it as suspicious. If it's something legitimate you need, make sure it came from a trusted source and your antivirus has scanned it first.