Looking for PDF, Word and ZIP files or spreadsheets… in your three million Gmail emails? Learn here how to search Gmail for an attachment by file type using smart search operators.
First, Jump into Brazilian Waters and Swim South
Do it for, say, a day, and some forty miles from Latin America’s biggest harbor at Santos, you will come across a small, picturesque island inhabited by no people.
Instead, the Ilha de Queimada Grande is populated by thousands of pit vipers.
Now that we know how to find venomous snakes by sea, let’s see how to find archives by Gmail:
How to Search Gmail by Attachment File Type
Time needed: 2 minutes
To search for attachments (in general or by file type)—files that contain multiple documents or perhaps entire folders, for example, often compressed using ZIP—in Gmail:
- Click or tap your Gmail’s Search mail field.
- Type
has:attachment
Archive files: To find all emails that have archived files as attachments, use
(has:attachment AND (filename:zip OR filename:gz OR filename:bz2 OR filename:tgz OR filename:gz OR filename:7z OR filename:cab OR filename:dmg OR filename:xar OR filename:zoo))
Note: This will find all kinds of compressed files and archives; to search only for ZIP files, typefilename:zip
.
Tip: If typing tires you, see below for copyable searches. - Optional: Add
AND filename:<extension>
and replace “<extension>” with a file type such aspdf
,doc
orzip
.Example—archive files: To find all emails that have archived files as attachments, use
(has:attachment AND (filename:zip OR filename:gz OR filename:bz2 OR filename:tgz OR filename:gz OR filename:7z OR filename:cab OR filename:dmg OR filename:xar OR filename:zoo))
Note: This will find all kinds of compressed files and archives; to search only for ZIP files, typefilename:zip
.
The biggies: You can also use search operators to find large attachments in Gmail, of course. - Press Enter.
Refined search: You can combine the search terms with other words, of course, and Gmail search operators such as
from:
,subject:.
ordate:
.
Example: Use(has:attachment AND (filename:zip OR filename:tgz)) from:heinz newer_than:3m
to find emails with ZIP or TGZ attachments from anybody named “Heinz” received in the last 3 months.
Looking for messages you have archived? How to view archived Gmail emails.
How to Search Gmail by Attachment File Type: FAQ
Do you have search shortcuts I can copy?
Yes, to get started with common attachment archive type searches, copy one of the following:
Search String | |
---|---|
(has:attachment AND (filename:zip OR filename:gz OR filename:bz2 OR OR filename:tgz OR filename:gz OR filename:7z OR filename:cab OR filename:dmg OR filename:xar OR filename:zoo)) | |
(has:attachment AND (filename:zip OR filename:tgz)) |
Speaking of PDF: How to Save an Email as PDF in Gmail
Will I find messages with files attached that have the file extension in their name?
Yes.
If you search for filename:zip
in Gmail, results include files whose extension begins with “zip” and, alas, files whose name starts with “zip,” for example. Files that have “zip” somewhere in the middle will not show up.
Gmail will return an email with a attachment called “zipper.jpg,” for instance.
(Lamentably, filename:.zip
, filename:".zip"
, filename:\.zip
and filename:zip$
will return all the same result.)
Can I search inside archives and ZIP files with Gmail?
No.
Gmail does not search within ZIP file contents (or those of other archive formats). It does not let you search for filenames zipped up into an archive either.
Can I search for attachment in the Gmail apps for Android and iOS?
Yes.
You can search for ZIP and other archive files using the search terms above in the Gmail apps.
How do I search for attached files in Gmail Basic HTML?
The Gmail search for archives works just as well in simple HTML Gmail.
(How to search Gmail by attachment file type tested in a desktop browser; first published July 2020, last updated October 2024)