Free tool · no signup

Gmail Search Operator Builder

Gmail search operators are the keywords that turn the search box into a query language: from:, subject:, has:attachment, older_than: and about twenty more. This builder assembles them visually, shows the exact query string, and opens it in Gmail in one click — plus a complete operator reference with the Outlook equivalents.

Runs entirely in your browser. Nothing you paste is uploaded, logged or stored.

Your query

Open in Gmail
Pick a recipe or fill a field below.

Start from a recipe

People

Sender address or name. A bare name matches the display name too.

Recipient. `to:me` is the fastest way to exclude list mail you were only bcc'd on.

Matches the Cc line only.

Only works on mail you sent — you can't see someone else's Bcc.

Content & state

Searches the subject line only. Quote a phrase to keep the words together.

Wrapped in quotes — matches the words in that order, anywhere in the message.

A leading minus removes matches. The single most effective way to cut a noisy result set.

Time

Format YYYY/MM/DD. Inclusive of the date given.

Format YYYY/MM/DD.

toolsUi.gmailOperators.older_than.hint

toolsUi.gmailOperators.newer_than.hint

Location

Gmail labels. Use a hyphen for nested labels: label:clients-uk.

toolsUi.gmailOperators.category.hint

toolsUi.gmailOperators.in.hint

Attachments & size

An extension alone works: filename:pdf. So does a full name.

Accepts M or K. `larger:10M older_than:1y` is the mailbox-quota search.

Rarely useful alone; pairs well with has:attachment.

Nothing selected yet. Every field maps to one operator, and empty fields are left out of the query entirely.

Full operator reference, with Outlook equivalents
GmailDoesOutlook
from:Sender address or name. A bare name matches the display name too.from:
to:Recipient. `to:me` is the fastest way to exclude list mail you were only bcc'd on.to:
cc:Matches the Cc line only.cc:
bcc:Only works on mail you sent — you can't see someone else's Bcc.
subject:Searches the subject line only. Quote a phrase to keep the words together.subject:
"…"Wrapped in quotes — matches the words in that order, anywhere in the message.
-A leading minus removes matches. The single most effective way to cut a noisy result set.NOT
label:Gmail labels. Use a hyphen for nested labels: label:clients-uk.
category:toolsUi.gmailOperators.category.hint
in:toolsUi.gmailOperators.in.hintfolder:
after:Format YYYY/MM/DD. Inclusive of the date given.received>=
before:Format YYYY/MM/DD.received<=
older_than:toolsUi.gmailOperators.older_than.hint
newer_than:toolsUi.gmailOperators.newer_than.hint
has:attachmentAny attachment, including inline images — which is why results look inflated.hasattachment:yes
filename:An extension alone works: filename:pdf. So does a full name.attachment:
larger:Accepts M or K. `larger:10M older_than:1y` is the mailbox-quota search.
smaller:Rarely useful alone; pairs well with has:attachment.
is:unreadCombine with in:inbox to get the real backlog.isread:no
is:starredGmail stars. Outlook's flags behave differently.
is:importantGmail's own priority guess, not your stars.
has:nouserlabelsEverything your filters never caught — the honest measure of how good your rules are.
  • Every common operator as a labelled field — no syntax to remember
  • Live query string, copyable, plus a one-click open in Gmail
  • Six worked recipes: reclaim space, real unread backlog, unlabelled mail
  • Notes on the traps — quoting multi-word values, in:anywhere, relative dates
  • Outlook / Microsoft 365 equivalents alongside each operator
  • Anything you build is reusable as a Gmail filter

How to use it

Four steps, about thirty seconds

  1. 01

    Pick a recipe, or start empty

    The recipes cover the searches most people actually want; each one loads into the builder so you can adjust it.

  2. 02

    Fill in the fields you need

    Every field maps to one operator. Empty fields are left out of the query entirely.

  3. 03

    Copy the query

    The string updates as you type. Paste it into Gmail's search box, or use the button to open it directly.

  4. 04

    Turn it into a filter

    In Gmail, run the search, then click the filter icon in the search bar and choose Create filter — the query carries over intact.

Syntax

The four rules the whole query language runs on

Gmail search looks like a language and behaves like four rules. Learn these and the operator list becomes a reference rather than something to memorise.

A space means AND. Two terms side by side must both match — which is why subject:renewal quote does not do what people expect. Quotes bind words together. subject:"renewal quote" searches for the phrase. A leading minus excludes. -unsubscribe removes every match containing that word, and is the single fastest way to cut a noisy result set. OR must be capitalised. from:ada OR from:grace works; a lowercase or is searched as a word.

How a Gmail search query is assembledOperators are joined by spaces, which Gmail reads as AND. A leading minus excludes. Multi-word values must be quoted or the second word is treated as a separate search term.from:[email protected] subject:"renewal quote" older_than:3m -unsubscribeoperatorquoted = one phraserelative dateminus excludesA space means AND. Without the quotes, subject:renewal quote searches subjects for “renewal” and anywhere for “quote”.
Everything else is just which operator you put in front of the value.

Traps

Five things that silently return the wrong results

None of these produce an error. They produce a plausible-looking result set that is missing what you were looking for, which is worse.

What you typeWhat Gmail doesWhat to type instead
subject:renewal quoteSubject contains 'renewal' AND the message contains 'quote' anywhere.subject:"renewal quote"
from:[email protected]Searches the inbox and archive — but not Spam or Trash, where the missing message usually is.from:[email protected] in:anywhere
after:31/01/2026Nothing useful — Gmail expects YYYY/MM/DD.after:2026/01/31
has:attachmentIncludes inline images and signature logos, which is why the count looks absurd.has:attachment filename:pdf
is:unreadEvery unread message everywhere, including years of promotions.is:unread in:inbox category:primary

From search to rule

Any search here can become a standing filter

A search you run twice should be a filter. In Gmail: run the query, click the filter icon at the right of the search box, and choose “Create filter”. The operators carry across intact, so anything the builder produces can be turned into a rule that labels, archives, stars or forwards automatically from then on.

Two cautions. Use relative dates in filters (older_than:1y), never fixed ones — a filter with before:2026/01/01 quietly stops matching anything new. And avoid “Skip the Inbox” on a filter you are not certain about: mail that never appears is far harder to notice than mail that appears and is wrong.

The honest limit of all of this: filters match patterns, not meaning. subject:invoice catches the word, not the invoice that arrived titled “Re: our conversation”. Syntax can only ever sort mail by its shape.

Outlook

The same searches in Outlook and Microsoft 365

Outlook has the same idea with different spelling, and the operator table above lists the equivalent for every operator that has one. The four that differ most: has:attachment becomes hasattachment:yes, after: becomes received>=, in: becomes folder:, and Gmail’s leading minus becomes a capitalised NOT.

Two Gmail operators have no Outlook equivalent at all: category:, because Outlook has no inbox tabs, and has:nouserlabels, because Outlook organises by folder rather than by label. The nearest Outlook equivalent to the second is simply looking at the inbox root.

Questions

Frequently asked

Short answers, including the ones where the honest answer is “this tool can’t do that”.

Keywords that narrow a Gmail search: from: limits by sender, subject: to the subject line, has:attachment to messages with files, older_than: by age. They combine with spaces (which mean AND), OR, and a leading minus for NOT.

The product behind the tool

AI Emaily does the part this tool can’t: the reply.

A free tool cleans up a list or builds a link. AI Emaily reads the thread, drafts the answer in the voice you set, and waits for one click — across Gmail, Outlook, iCloud and any IMAP mailbox. You approve every send.

Ready when you are

Email, finally worthy of your attention.

Start your 7-day free trial. Cancel anytime.

  • 7-day free trial
  • Cancel anytime
  • Every provider