Home › Tools › Gmail search builder
Free tool · Gmail

Gmail search builder for invoices, receipts and attachments

Tick what you are looking for (file type, keywords, sender, quarter, size) and get the exact Gmail search instantly. Copy it or open it straight in your inbox. No sign-up, and nothing is sent to any server: everything happens in your browser.

Works with personal Gmail and Google Workspace · Uses only official Gmail search operators

Start from a template (optional)

One click fills in the form; then adjust anything you like.

File type

None ticked = any file type. Several are combined with "or".

Words it must contain

Any one of them is enough. Phrases with spaces are put in quotes automatically.

Several, comma separated (from:).

Added with a minus sign in front (-from:).

Useful if invoices arrive at an alias or shared mailbox (to:).

Date range

Written as after:YYYY/MM/DD and before:YYYY/MM/DD. Quarters are calendar quarters (Q1 = Jan–Mar). "Until" does not include that day: for all of September, set it to October 1.

newer_than:

older_than:

larger:

in:

Search only inside one of your labels (label:). Spaces become hyphens, as Gmail does.

Your Gmail search

    The link opens the first Gmail account in your browser (/u/0/). The search is built in your browser and is not sent to any server.

    What each operator does

    Type them into the Gmail search bar with no space after the colon. A space between two operators means "and": the email has to match both.

    OperatorWhat it doesExample
    has:attachmentEmails with at least one attachment.has:attachment
    filename:Attachments with an extension or a word in the file name.filename:pdf · filename:invoice
    from: / to:Sent by, or sent to, an address or domain.from:supplier.com
    subject:A word or phrase in the subject line.subject:(invoice OR receipt)
    after: / before:Received on/after or before a date, in YYYY/MM/DD format.after:2026/07/01 before:2026/10/01
    newer_than: / older_than:Newer / older than a period: d days, m months, y years.newer_than:3m
    larger: / smaller:By email size (attachments included). Use K or M.larger:10M
    label:Emails with one of your labels.label:vendors
    in:A specific folder: inbox, sent, spam, trash… or anywhere to include Spam and Trash.in:anywhere
    is:unreadUnread emails only.is:unread
    category:Inbox tabs: primary, promotions, social, updates, forums.-category:promotions
    OR · { }One criterion or the other. Curly braces group alternatives without typing OR.{filename:pdf filename:xml}
    - (minus)Excludes whatever follows it.-from:newsletter@store.com
    " " · ( )Quotes for an exact phrase; parentheses to group."purchase order"

    Source: Gmail Help, "Refine searches in Gmail".

    Common mistakes (and how to avoid them)

    Turn the search into a filter with a label

    If you run the same search every month, let Gmail label those emails as they arrive:

    1. Paste the search into Gmail

      Use the "Open in Gmail" button or paste it into the search bar. For a filter, remove the dates (after:, before:, newer_than:), is:unread, in: and label:: a filter applies to new mail, so those criteria make no sense there.

    2. Open the search options

      Click the "Show search options" icon on the right of the search bar, then Create filter.

    3. Choose the label

      Tick Apply the label and create a new one, for example "Invoices". Optionally tick Also apply filter to matching conversations to label the ones you already have.

    4. Search by label

      From then on, label:invoices after:2026/07/01 before:2026/10/01 gives you the quarter's invoices in a second.

    And once you have found them?

    The search tells you where the invoices are, but they are still inside Gmail. To send them to your bookkeeper or accountant, or keep them on file, you have to download them or save them to Drive one by one, every month. And if you also get invoices in Outlook or on your own domain's mailbox, you repeat it for each inbox.

    Inbox2Drive does that step for you. It connects Gmail, Outlook and IMAP mailboxes, classifies each attachment with AI (invoice, receipt, contract, pay stub…) and saves it into organized Google Drive or Dropbox folders by type, date or sender. It can also import past emails, so what you would find today with a search gets filed the same way. It never sends or deletes email. How it works with Google Drive · with Dropbox.

    Try it free with my Gmail

    Free plan, no credit card · Questions? Email us at marketing@inbox2drive.com

    FAQ

    Is this tool free? What does it do with my data?

    It is free and runs entirely in your browser: the search is built on your device and is not sent to any server. The "Open in Gmail" button only opens your own Gmail with the search filled in; we do not need access to your email.

    Why can't Gmail find an invoice I know I have?

    The most common reasons: the email is in Spam or Trash (add in:anywhere), the date is written as MM/DD/YYYY instead of YYYY/MM/DD, the invoice came as a download link rather than an attachment (remove has:attachment), or the file has a different extension (for example .zip instead of .pdf).

    The button opens the wrong Gmail account. How do I change it?

    The link uses /mail/u/0/, which is the first account you signed in to in your browser. If you have several, change the 0 to 1, 2 and so on in the address bar, or copy the search and paste it into the search box of the right account.

    Do these searches work in the Gmail mobile app?

    Yes, the search box in the Gmail app accepts the same operators. Copy the search and paste it into the app's search box.

    Can Gmail save these attachments to Google Drive automatically?

    Not natively: Gmail only lets you save attachments to Drive one at a time with the Drive icon. To do it automatically you need a script, an add-on or a tool such as Inbox2Drive.

    Keep reading

    Stop hunting for invoices every month

    Inbox2Drive connects Gmail, Outlook and IMAP, classifies attachments with AI and saves them into organized Google Drive or Dropbox folders.

    Create a free account

    Free plan · No credit card required · Help by email at marketing@inbox2drive.com

    Using Outlook instead? Try the Outlook search builder for attachments & invoices.