How to Search Gmail by Attachment File Type

Search Gmail by Attachment File Type

Looking for PDF, Word, or ZIP files… 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

Looking for messages you’ve archived? How to view archived Gmail emails.

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:

  1. Click or tap your Gmail’s Search mail field.

  2. 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, type filename:zip.
    Tip: If typing tires you, see below for copyable searches.

  3. Optional: Add AND filename:<extension> and replace “<extension>” with a file type such as pdf, doc or zip.

    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, type filename:zip.

  4. Press Enter.

    Refined search: You can combine the search terms with other words, of course, and Gmail search operators such as from:, subject:. or date:.
    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.Finding archives in Gmail

Looking for big files? How to Find Large Attachments in Gmail

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))

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; updated November 2023)

Home » Email Tips and Resources » Gmail Tips and Resources » How to Search Gmail by Attachment File Type