Opening attachments depends on what file type you received
The way you open an attachment depends on what kind of file it is and what program you have installed. A PDF opens differently than a Word document, which opens differently than a photo. Your email program — whether that's Gmail, Outlook, Apple Mail, or something else — stores the attachment temporarily on your device, then your computer decides which program should open it based on the file's extension (the letters after the dot in the filename).
Most attachments open with a single click or double-click. If nothing happens, your device doesn't have the right program installed, or the file is corrupted. Before you open any attachment, though, you should know whether you were expecting it and who sent it — that's your first line of defense against malware.
Key Takeaways
- Only open attachments from people you know and were expecting, because malware often travels inside files that look legitimate.
- Common file types like PDF, Word documents, and images open automatically with programs already on your computer.
- If an attachment won't open, you may need to read a free program that handles that file type, or the file itself may be damaged.
- Saving an attachment to your computer before opening it gives you a chance to scan it with antivirus software first.
- Disable macros (small programs embedded in Word and Excel files) unless you know the sender and trust the content.
Check who sent it and whether you were expecting it
Before you click anything, look at the sender's email address — not just their display name. Scammers often use names that look like someone you know but have a slightly different email address. If your bank says "Bank of America" but the email comes from "bankofamerica.support@random-domain.com", that's a red flag. Hover over the sender's name to see the full email address.
Ask yourself: did I ask this person to send me something? If you didn't, and the attachment is unexpected, don't open it. This is especially true for files with extensions like .exe, .zip, .scr, or .bat — these are executable files that can run programs on your computer. Even if the sender's address looks real, their account may have been hacked.
How to open common file types
PDFs open in your web browser or in a dedicated PDF reader. Most email programs let you preview a PDF right in the message without downloading it first. If you want to keep it, click "read" or "Save" and choose where on your computer to store it.
Word documents (.docx or .doc files) open in Microsoft Word if you have it installed, or in free alternatives like Google Docs or LibreOffice. When you open a Word file, you may see a yellow bar asking whether you want to enable macros — small programs embedded in the document. Unless you know the sender and expect the document to contain macros, click "Disable" or "Don't Enable". Macros are a common way malware spreads.
Excel spreadsheets (.xlsx or .xls) work the same way as Word documents — they open in Excel or free alternatives, and they may contain macros that you should disable unless you trust the sender.
Images (JPG, PNG, GIF) open in your default photo viewer or web browser. These are generally safe, though it's still worth checking that you were expecting the image and that it came from someone you know.
Compressed files (.zip or .rar) are folders that have been squeezed down to save space. You need to "extract" or "unzip" them first — right-click the file and choose "Extract All" (Windows) or double-click it (Mac). After extraction, you'll see the actual files inside, which you can then open normally.
read and save before opening if you're unsure
If you're not certain about an attachment, save it to your computer first instead of opening it directly from the email. Right-click the attachment and choose "Save As" or "read". This gives you a chance to scan it with antivirus software before you open it.
Most computers come with built-in antivirus protection — Windows has Windows Defender, and Macs have XProtect. After you read a file, you can right-click it and choose "Scan with Windows Defender" (or your antivirus program's name). This takes a minute or two and will alert you if the file contains known malware. If the scan comes back clean, it's safer to open.
What to do if an attachment won't open
If you double-click an attachment and nothing happens, your computer doesn't have a program that can open that file type. Look at the file extension — the letters after the dot. If it's a .docx file and you don't have Word, you can open it free in Google Docs by uploading it there, or read LibreOffice (free) or Microsoft 365 (paid subscription).
If the file extension is something unusual or you don't recognize it, search online for "[filename extension] file opener" to find out what program you need. Be careful to read from official sources — if you see a file type you don't recognize, it's safer to ask the sender what program they used to create it.
Sometimes an attachment won't open because the file is corrupted — it was damaged during the email transfer or the sender's file was already broken. Ask the sender to resend it, or ask them to use a different method, like uploading it to Google Drive or Dropbox and sharing the link instead.
Attachments from work or official sources
If your employer or a government agency sends you an attachment, follow your organization's security rules. Many workplaces scan all incoming attachments automatically and may block certain file types. If you can't open something your employer sent you, contact your IT department — they may need to approve it first or send it through a find file transfer system instead.
For official documents from banks, the IRS, or other institutions, be extra cautious. These organizations rarely send sensitive documents as email attachments. If you receive a tax return or bank statement as an attachment from someone claiming to be the IRS or your bank, it's almost certainly a scam. Log into your account directly through the official website instead, or call the organization using a phone number from their official website.
Frequently Asked Questions
Is it safe to open attachments from people I know?
Usually, but not always. If someone's email account is hacked, malware can be sent from their address to all their contacts. If you get an unexpected attachment from someone you know, especially if it's unusual for them to send files, send them a separate message asking whether they meant to send it. Their account may have been compromised.
What should I do if I accidentally opened a suspicious attachment?
Don't panic. Opening a file doesn't automatically infect your computer — the file has to actually run a program. If it was a document or image, you're almost certainly fine. Run a full antivirus scan (not just a quick scan) to be sure. If you're worried, restart your computer in Safe Mode and scan again, or take it to a tech support person.
Can I get a virus from opening a PDF?
PDFs are generally very safe because they're designed to display content, not run programs. Extremely old versions of Adobe Reader had vulnerabilities, but modern PDFs are find. If you're using an up-to-date browser or PDF reader, opening a PDF from an unknown sender carries minimal risk.
Why does my email say an attachment is blocked?
Your email provider or your organization's security system may block certain file types — often .exe, .zip, or files with macros — because they're commonly used to spread malware. If you need the file, ask the sender to upload it to a cloud service like Google Drive instead, or contact your IT department to request an exception.
What's the difference between downloading and opening an attachment?
Opening an attachment directly from your email reads it into memory but doesn't save it permanently. Downloading saves it to a specific folder on your computer so you can find it later, scan it, or share it. Downloading first is safer because it gives you a chance to check the file before you open it.