Gmail advanced search
Gmail search operators: the complete cheat sheet.
Type an operator into the Gmail search bar to narrow results: from: for the sender, subject: for the subject line, is:unread for unread mail, in:anywhere to include Spam and Trash, and newer_than: or older_than: for dates. Combine several in one search; a space means AND, and OR or braces mean either.
Last updated
Gmail search operators are short commands that narrow search by sender, subject, location, unread state, attachment, date, and exact phrases. Start broad, then add operators until the result set is safe to review. Google's current operator list is available in its official Gmail search reference.
Operators can be combined in one query. Spaces behave like AND, braces or OR join alternatives, a minus sign excludes a term, and quotation marks keep an exact phrase together. Test complex searches before using them as the criteria for a filter.
Gmail search operator reference
| Operator | Finds | Example |
|---|---|---|
| from: | Messages from a sender | from:alex@example.com |
| to: | Messages sent to a recipient | to:billing@example.com |
| cc: / bcc: | Messages copied to a recipient | cc:sam@example.com |
| subject: | Words in the subject | subject:"quarterly report" |
| in:inbox | Mail currently in the inbox | in:inbox from:alex |
| in:anywhere | All Mail, including Spam and Trash | in:anywhere invoice |
| in:sent / in:spam / in:trash | Mail in one folder | in:sent to:sam |
| is:unread / is:read | Mail by read state | is:unread |
| is:starred | Starred mail | is:starred older_than:30d |
| is:important | Mail Gmail marked important | is:important is:unread |
| in:snoozed | Snoozed mail | in:snoozed birthday reminder |
| in:archive | Archived mail | in:archive payment reminder |
| is:muted | Muted conversations | is:muted subject:standup |
| category: | Mail in an inbox tab | category:primary is:unread |
| label: | Mail with a Gmail label | label:customers |
| has:userlabels / has:nouserlabels | Mail with or without your own labels | has:nouserlabels in:inbox |
| has:attachment | Messages with attachments | has:attachment |
| filename: | Attachment name or type | filename:pdf |
| has:drive / has:document / has:spreadsheet | Mail with Google Drive links or files | has:spreadsheet from:finance |
| has:youtube | Mail with a YouTube video | has:youtube |
| list: | Mail from a mailing list | list:info@example.com |
| after: / before: | Mail inside a date range | after:2026/01/01 before:2026/02/01 |
| newer_than: | Mail newer than an age (d, m, y) | newer_than:7d |
| older_than: | Mail older than an age (d, m, y) | older_than:1y |
| larger: / smaller: | Mail by approximate size | larger:10M |
| size: | Mail larger than a size in bytes | size:1000000 |
| deliveredto: | Mail delivered to an address | deliveredto:alias@example.com |
| rfc822msgid: | One message by its Message-ID header | rfc822msgid:200503292@example.com |
| { } or OR | Either of multiple terms | {from:alex from:sam} |
| - | Results without a term | -label:newsletters |
| AROUND | Words near each other | holiday AROUND 10 vacation |
| " " | An exact phrase | "project northstar" |
| ( ) | Group terms together | subject:(dinner film) |
| + | An exact word only | +unicorn |
Beyond search
Want Gmail to only show mail from people you know?
Search finds mail after it arrives. KeepKnown checks each new sender against your Google Contacts and moves strangers to a KK:OUTSIDERS label, so your inbox shows people you know and nothing is deleted.
The audit is free and changes nothing in your inbox.
Useful combined Gmail searches
from:alex@example.com subject:"invoice" has:attachment
Find invoices with attachments from one sender.
in:anywhere is:unread older_than:30d
Find unread mail older than 30 days, including archived mail, Spam, and Trash.
{from:alex@example.com from:sam@example.com} -label:done
Find mail from either sender unless it is already done.
in:inbox category:primary is:unread
Find unread messages currently in the Primary inbox tab.
has:attachment filename:pdf larger:5M newer_than:1y
Find recent large PDF attachments for storage cleanup.
in:anywhere newer_than:1d
See everything that arrived in the last day, including mail that a filter archived or Gmail sent to Spam.
is:unread -in:inbox
Find unread mail that is no longer in the inbox, such as messages a filter archived without marking them read.
Three search details that prevent surprises
Conversations can broaden exclusions
A conversation may appear when one message matches even if another message in the same thread meets an exclusion.
in:anywhere includes Spam and Trash
Use the operator deliberately when the visible inbox and All Mail are not broad enough.
Search before automation
A search result is the preview for a native Gmail filter. Inspect it before choosing Create filter.
Ongoing prevention
Search finds old mail; screening reduces the next backlog.
Gmail operators help you clean up existing mail. KeepKnown screens unknown senders before they create more unread inbox work.
Questions before you connect.
What are Gmail search operators?
They are search commands such as from:, subject:, in:anywhere, is:unread, older_than:, and has:attachment that narrow Gmail results.
Which Gmail operator searches all mail?
Use in:anywhere when you need Gmail to search beyond the visible inbox, including archived mail, Spam, and Trash.
How do I combine Gmail search operators?
Place operators in the same query for AND logic, use OR or braces for alternatives, use a minus sign to exclude, and quote exact phrases.
Can Gmail search operators be used in filters?
Many search criteria can be used to create a filter. Run the search first and inspect the matches before saving any automatic action.
Is there a Gmail search operator for senders not in my contacts?
No. Operators match addresses, words, labels, dates, and states, but none checks Google Contacts. Contact-based screening needs a tool such as KeepKnown.
Do Gmail search operators work in the Gmail app?
Yes. Type the same operators, such as is:unread or from:, into the search bar of the Gmail app on Android or iPhone.
Gmail search cleanup
Find old outsider mail, then stop the next backlog.