Most unexpected attachments are not safe to open, and deleting them costs you nothing
An unexpected attachment is one that arrives from someone you do not know, or from someone you know but who would not normally send you that type of file. The safest answer is almost always to delete it without opening it. Opening an attachment you did not ask for is how most people get malware — software designed to steal passwords, financial information, or access to your computer.
The risk is real because attachments can look harmless while containing hidden code that runs the moment you open them. A file named "Invoice.pdf" or "Photo.jpg" might actually be a program that installs spyware. You cannot tell by looking at the filename or the preview. Once it runs, the damage is done — and you may not notice for weeks or months.
The one exception is when you initiated the contact first. If you emailed someone asking for a document, and they sent it back, that attachment is almost certainly safe. Everything else — files from strangers, files from known contacts who are acting out of character, files you did not ask for — should be deleted.
Key Takeaways
- Delete any attachment from someone you do not know, or from a known contact sending something you did not request.
- Malware hides inside files that look ordinary, so a harmless-looking filename does not mean the attachment is safe.
- The only attachments worth opening are ones you asked for first, from a person or organization you trust.
- If you are unsure whether someone really sent an email, contact them through a phone number or website you know is theirs, not by replying to the email.
- Antivirus software catches some malware but not all, so it is not a reason to open an attachment you did not ask for.
How to spot an attachment that is probably malware
Certain patterns show up again and again in emails carrying malware. The sender claims you owe money, have a package waiting, need to verify your account, or have won something. The email creates a sense of urgency — "act now" or "your account will be closed." None of this is accidental. Attackers use pressure and fear because they work.
Watch for emails that claim to be from your bank, PayPal, Amazon, or your email provider, but the sender's address looks slightly off. Scammers register addresses like "paypa1.com" (with the number one instead of the letter L) or "amaz0n-security.com" (with a zero). Your real bank will never ask you to open an attachment to verify your account. They will direct you to log in through their official website or call their customer service number on the back of your card.
Attachments with double file extensions are a red flag. A file named "Document.pdf.exe" is actually a program disguised to look like a PDF. Windows hides the final ".exe" by default on many computers, so you see only "Document.pdf" — but the program runs anyway when you open it. If you see a filename with two dots and two different file types, delete it.
What to do if you opened an attachment by accident
If you opened an attachment before realizing it was risky, do not panic. Many attachments are harmless even if they came from an untrusted source. But you should take steps to check your computer and protect your accounts.
First, disconnect your computer from the internet if you can do so safely — unplug the ethernet cable or turn off WiFi. This prevents any malware from sending data out or downloading more code. Then run a full scan with your antivirus software. Windows Defender (built into Windows) and Malwarebytes are both free options. The scan may take 30 minutes to an hour. If it finds threats, let it remove them.
After the scan, change your passwords for email, banking, and any other sensitive accounts. Use a different computer or phone to do this if possible, so you are not typing passwords on a potentially infected machine. If you use the same password for multiple sites, change all of them. Consider placing a fraud alert with the three major credit bureaus — Equifax, Experian, and TransUnion — by calling any one of them. This is free and makes it harder for someone to open accounts in your name.
Attachments from people you know can still carry malware
A common attack is to hack someone's email account, then send malware to all their contacts. The email looks like it came from your friend or colleague, but it is actually a criminal using their account. This is why you should be suspicious even of attachments from people you know, if the attachment is unexpected or the message seems out of character.
If your friend suddenly sends you an attachment with no message, or a message that does not sound like them, contact them through another method — a phone call, a text message, or a message on social media — and ask if they really sent it. Most of the time they will say no, and you will have avoided opening malware. If they say yes, ask them what the file is before you open it. A real person can explain what they sent and why.
When file type matters, and when it does not
Some file types are riskier than others. Executable files — programs that run code — are the highest risk. These include .exe, .com, .bat, .cmd, .scr, and .msi files on Windows, and .app and .dmg files on Mac. If you receive any of these from an unexpected source, delete them without opening them.
Office documents like .docx (Word), .xlsx (Excel), and .pptx (PowerPoint) are medium risk. They can contain malicious code hidden inside macros — small programs that run when you open the file. Microsoft Office will usually ask you before running a macro from an untrusted source, but not always. If you receive an Office document you did not ask for, delete it.
PDFs, images, and text files are lower risk, but not zero risk. Vulnerabilities in PDF readers have been exploited before. The safest rule is still: if you did not ask for it, do not open it. The file type matters less than whether you expected the attachment in the first place.
Why antivirus software is not enough
Antivirus and antimalware programs are useful, but they are not a reason to open unexpected attachments. They catch known malware — code that has been seen before and added to their database. But new malware is created every day, and security software cannot catch what it has never seen. Criminals deliberately design new attacks to slip past antivirus programs.
Think of antivirus as a safety net, not a shield. It catches some of what falls through, but the best protection is not falling in the first place. That means not opening attachments you did not ask for, no matter what security software you have running.
Frequently Asked Questions
Is it safe to open an attachment if I hover over it first?
No. Hovering over a file or looking at a preview does not tell you whether it is safe. Malware can hide inside files that look completely normal. The only safe preview is one that your email program shows you automatically, without opening the actual file. If you are not sure, delete it.
What if the attachment is from my bank or credit card company?
Your bank will not send you attachments asking you to verify your account or update your information. If an email claims to be from your bank and has an attachment, it is almost certainly fake. Go to your bank's official website or call the number on the back of your card instead.
Can I get malware from opening a PDF?
PDFs are lower risk than executable files or Office documents, but vulnerabilities have existed in PDF readers before. If the PDF came from an unexpected source, the safest choice is still to delete it. If you must open it, make sure your PDF reader is up to date.
What should I do if someone I know sent me an attachment I did not ask for?
Contact them through phone, text, or social media and ask if they really sent it. Their email account may have been hacked. A real person can tell you what the file is and why they sent it. If they cannot explain it, do not open it.
Does opening an attachment in a preview pane infect my computer?
Most email programs are designed so that previewing an attachment does not run any code inside it. However, some older vulnerabilities have allowed malware to run through preview alone. The safest approach is to not preview unexpected attachments at all — just delete them.