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.

from:subject:in:anywhereis:unread

Last updated

Gmail search bar showing combined from, subject, unread, date, and attachment operators

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

OperatorFindsExample
from:Messages from a senderfrom:alex@example.com
to:Messages sent to a recipientto:billing@example.com
cc: / bcc:Messages copied to a recipientcc:sam@example.com
subject:Words in the subjectsubject:"quarterly report"
in:inboxMail currently in the inboxin:inbox from:alex
in:anywhereAll Mail, including Spam and Trashin:anywhere invoice
in:sent / in:spam / in:trashMail in one folderin:sent to:sam
is:unread / is:readMail by read stateis:unread
is:starredStarred mailis:starred older_than:30d
is:importantMail Gmail marked importantis:important is:unread
in:snoozedSnoozed mailin:snoozed birthday reminder
in:archiveArchived mailin:archive payment reminder
is:mutedMuted conversationsis:muted subject:standup
category:Mail in an inbox tabcategory:primary is:unread
label:Mail with a Gmail labellabel:customers
has:userlabels / has:nouserlabelsMail with or without your own labelshas:nouserlabels in:inbox
has:attachmentMessages with attachmentshas:attachment
filename:Attachment name or typefilename:pdf
has:drive / has:document / has:spreadsheetMail with Google Drive links or fileshas:spreadsheet from:finance
has:youtubeMail with a YouTube videohas:youtube
list:Mail from a mailing listlist:info@example.com
after: / before:Mail inside a date rangeafter: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 sizelarger:10M
size:Mail larger than a size in bytessize:1000000
deliveredto:Mail delivered to an addressdeliveredto:alias@example.com
rfc822msgid:One message by its Message-ID headerrfc822msgid:200503292@example.com
{ } or OREither of multiple terms{from:alex from:sam}
-Results without a term-label:newsletters
AROUNDWords near each otherholiday AROUND 10 vacation
" "An exact phrase"project northstar"
( )Group terms togethersubject:(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.