How do I use Google search operators in Gmail?
Last reviewed: September 23, 2026 · Markdown version
Gmail's search box is a query language, and about fifteen of its operators do almost all
the useful work. Every operator below is on Gmail's own reference page
(Refine searches in Gmail, read 23 September 2026); the combined examples are ours.
Note first that these are Gmail's operators — site: and filetype: belong to
Google Search, a different set for a different box
(Refine Google searches, read 23 September 2026).
Who and what
from:·to:·cc:·bcc:— addresses. Google's examples use a full address,from:amy@example.com, orfrom:me.subject:— subject line only, which is usually what you actually remember.filename:— matches the attached file's name, including a bare extension:filename:pdf.list:— "Find emails from a mailing list", by the list's own address:list:info@example.com.
When
older_than:·newer_than:— relative, usingd,mory:older_than:1y.before:·after:— absolute dates, writtenafter:2024/04/16.
How big
larger:·smaller:·size:—larger:10Mtakes a unit; Google'ssize:example is a plain number,size:1000000.has:attachment, plushas:drive,has:document,has:spreadsheet,has:presentation,has:youtube.
⚠️ The number rule. Google states it plainly: "When using numbers as part of your query, a space or a dash (-) will separate a number while a dot (.) will be a decimal." Its own example: "01.2047-100 is considered 2 numbers: 01.2047 and 100." Google does not spell out what a split number does to the rest of a query, which is reason enough to type numbers in one piece.
Where, and state
in:anywhere— includes Spam and Trash, which by default "aren’t included in a standard search" (Search in Gmail, read 23 September 2026). It is the first thing to try when a message you know exists will not show up.in:archive·in:snoozed.is:unread·is:read·is:starred·is:important·is:muted.category:— if you use inbox categories:promotions,social,updates,forums, and a few more.has:userlabels·has:nouserlabels— mail with or without a label of yours. Google adds that labels "are only added to a message, and not an entire conversation".
Joining them up
OR (or curly braces) and AND, a leading - to exclude, and
AROUND for proximity — holiday AROUND 5 invoice. Parentheses group.
Three that earn their keep:
in:anywhere older_than:2y has:attachment larger:5M— old heavy mail, Spam and Trash included.category:promotions older_than:6m— the obvious clear-out, scoped by date so you do not catch this week's.from:amy@example.com -is:starred— one sender, minus what you starred. Google warns that with a negative operator "conversations with excluded criteria may still appear", so a starred message can surface inside a conversation that also holds an unstarred one.
What operators cannot do
They query messages. Nothing on Google's list groups or totals results by sender. A
larger: search finds every heavy message at once, and you still will not see the
newsletter that arrived every Tuesday for six years — each message too small to clear the threshold,
the total larger than anything on the list. Turning a search
into a standing rule is what filters are for.
How Gmail filters work.
Related: Find large emails in Gmail · What takes up space in Gmail? · Gmail filters · How to clean up Gmail