Free email toolsSearch
Gmail search operators
Build a search, or look an operator up. Every one in the list below comes from Google’s own help page, read on 19 November 2026.
Gmail’s search operators are short words you type into the search box to narrow a search: from:amy is:unread finds unread mail from Amy. The builder below writes a search for you. Under it are all 30 operators Google lists, with Google’s examples and whether each one also works in Roost’s ⌘K search.
Every Gmail search operator
This is Google’s list from its Gmail Help page “Refine searches in Gmail,” in Google’s order, read on 19 November 2026. The examples are Google’s. The last column is from Roost’s own search code, which I wrote, so you know which searches carry over.
| Operator | What it finds | Google’s examples | In Roost’s ⌘K |
|---|---|---|---|
from: | Mail sent from a person | from:me from:[email protected] | Yes, a name or address. “me” is read as a name. |
to: | Mail sent to a person | to:me to:[email protected] | Yes, addresses on the To line |
cc: bcc: | Mail with a person in the Cc or Bcc field | cc:[email protected] bcc:[email protected] | No |
subject: | A word or phrase in the subject line | subject:dinner subject:anniversary party | No. Plain words already search subjects. |
after: before: older: newer: | Mail received during a time period | after:2004/04/16 after:04/16/2004 before:2004/04/18 before:04/18/2004 | after: and before:, written 2004/04/16, 2004-04-16 or 16.04.2004. Not 04/16/2004, and no older: or newer: |
older_than: newer_than: | Older or newer than a time period, in d (day), m (month) or y (year) | older_than:1y newer_than:2d | Yes, and w for weeks |
OR { } | Mail that matches one or more of the terms | from:amy OR from:david {from:amy from:david} | No |
AND | Mail that matches all of the terms | from:amy AND to:david | Not needed: every word has to match. A typed AND is searched as the word “and.” |
- | Leaves out mail that matches | dinner -movie | No |
AROUND | Words near each other; the number is how many words apart | holiday AROUND 10 vacation "secret AROUND 25 birthday" | No |
label: | Mail under one of your labels | label:friends label:important | No. Open the folder from the sidebar. |
category: | Mail in one of the inbox categories, if you use them | category:primary category:social category:promotions category:updates category:forums category:reservations category:purchases | No |
has: | Mail with attachments, inline images, YouTube videos, Drive files, Google Docs, Sheets or Slides | has:attachment has:youtube has:drive has:document has:spreadsheet has:presentation | has:attachment only |
list: | Mail from a mailing list | list:[email protected] | No |
filename: | Attachments with a certain name or file type | filename:pdf filename:homework.txt | No |
" " | An exact word or phrase | "dinner and movie tonight" | Yes |
( ) | Groups several terms together | subject:(dinner movie) | No |
in:anywhere | Mail anywhere in Gmail, Spam and Trash included | in:anywhere movie | No. Roost searches every folder but Spam anyway; in:spam searches Spam. |
in:archive | Archived mail | in:archive payment reminder | Yes |
in:snoozed | Mail you snoozed | in:snoozed birthday reminder | No. Reply later has its own place in the sidebar. |
is:muted | Mail you muted | is:muted subject:team celebration | No |
is: | Mail by status: important, starred, unread or read | is:important is:starred is:unread is:read | is:unread, is:read, is:starred (Roost’s Flagged). Not is:important. |
has:yellow-star and the other star options | Mail under a star option, if you set several up | has:yellow-star OR has:purple-question | No |
deliveredto: | Mail delivered to a specific address | deliveredto:[email protected] | No |
size: larger: smaller: | Mail by its size | size:1000000 larger:10M | No |
+ | A word matched exactly | +unicorn | No. Every Roost word matches as a start: “invoic” finds invoices. |
rfc822msgid | Mail with a specific Message-ID header | rfc822msgid:[email protected] | No |
has:userlabels has:nouserlabels | Mail that has, or doesn’t have, a label | has:userlabels has:nouserlabels | No |
label:encryptedmail | Mail sent with client-side encryption | label:encryptedmail | No |
header: | Mail with a specific custom header or header value | header:X-Google-Calendar-Notification:rsvpWithNote | No |
Combining operators: OR, minus, brackets and quotes
Put operators side by side with spaces and Gmail looks for mail that matches all of them. from:amy is:unread newer_than:2d is unread mail from Amy in the past two days. Writing AND between them does the same thing.
Write OR in capitals, as Google does. Curly brackets mean the same: from:amy OR from:david and {from:amy from:david} both find mail from either. A minus sign leaves things out, as in dinner -movie. Google’s list has no NOT; the minus is how you exclude.
Round brackets group terms under one operator, so subject:(dinner movie) looks for both words in the subject. Quotes keep an exact phrase together: "dinner and movie tonight". And AROUND finds words close to each other, with the number saying how far apart they may be.
Two of Google’s tips are easy to miss. A minus can still show a conversation you meant to leave out, because Gmail matches single messages first: -is:starred finds a conversation if one message in it isn’t starred. And in numbers, a space or a dash separates two numbers while a dot is a decimal point, so Gmail reads 01.2047-100 as 01.2047 and 100. Google lists no wildcard operator.
Searching by date
Google gives two ways to write a date: after:2004/04/16 (year first) and after:04/16/2004 (month first). before: works the same way, so all of October is after:2026/10/01 before:2026/11/01. Google’s page doesn’t say which time zone the dates use.
For a moving window, newer_than: and older_than: take a number and d, m or y: newer_than:7d is the past week, older_than:1y is everything over a year old. They’re handy for clean-ups, as in older_than:1y -is:starred.
Searches people actually type
| You want | Gmail | Roost’s ⌘K |
|---|---|---|
| Unread mail from your boss in the past week | from:[email protected] is:unread newer_than:7d | The same |
| Big attachments, to free up space | has:attachment larger:10M | Not possible |
| PDFs since New Year | filename:pdf after:2026/01/01 | Not possible |
| Mail from either of two people | from:amy OR from:david | One search each |
| A phrase, but not in the newsletter | "quarterly report" -newsletter | "quarterly report" |
| Old mail you never starred | older_than:1y -is:starred | Not possible |
| An invoice, wherever it went | in:anywhere invoice | invoice (every folder but Spam) |
| October’s unread mail | is:unread after:2026/10/01 before:2026/11/01 | The same |
Search every inbox at once in Roost
Gmail’s operators only search Gmail. I make Roost, a Mac mail app that keeps Gmail, Outlook, iCloud, Yahoo, Fastmail and other inboxes in one window, and its search (⌘K) reads the Gmail words the table above marks as working, across all of them at once. Under the field it says what it understood, like “from anna · unread,” and a date it can’t read gets a message instead of a guess.
A few things differ from Gmail. Roost also reads in:inbox, in:sent, in:trash and in:spam, and is:flagged as well as is:starred. Spam is left out unless you ask with in:spam. Every word matches the start of a word, so “invoic” finds invoices. A word with a colon it doesn’t know, like label:x, is searched as plain words. It has no OR and no minus.
Roost searches the mail on your Mac first, which is the last 90 days plus older unread and flagged mail in the Inbox. For anything older, the last row of results, Search older mail on the servers, asks every inbox’s server at once. More on the search page.
Questions
Does Gmail have a NOT operator?
Not by that name. Google’s list uses the minus sign: dinner -movie finds mail about dinner that doesn’t mention a movie. It also works on other operators, as in -is:starred.
How do I use OR in Gmail search?
Type OR in capitals between two terms, like from:amy OR from:david, or put the terms in curly brackets: {from:amy from:david}. Both find mail that matches either.
How do I find only unread email in Gmail?
Search for is:unread. Add more to narrow it: is:unread from:amy, or is:unread newer_than:7d for the past week.
How do I search Gmail by date?
Use after: and before: with a date written 2026/10/01 or 10/01/2026, or newer_than: and older_than: with d, m or y, like newer_than:3d.
How do I search Gmail by size?
Use larger: or smaller:, or size: with a number of bytes. Google’s examples are larger:10M and size:1000000.
Is there a wildcard in Gmail search?
Google’s list of operators doesn’t include one. Roost’s search treats every word as the start of a word instead, so a part of a word is enough there.
Can I save a Gmail search?
Google’s tip is to turn it into a filter: after you search, you can use the results to set up a filter for those messages.
Sources
- Google, Gmail Help, “Refine searches in Gmail,” support.google.com/mail/answer/7190, read 19 November 2026.
- Roost 1.2 release notes, “Search words,” roostmail.app/changelog, read 19 November 2026. The Roost column was checked against Roost’s search code as of version 1.4.2.