Gmail Search Operators: The Complete Cheat Sheet
from:, subject:, has:attachment, after:, larger: and label:. Combine them with spaces (AND), OR, a minus sign to exclude, and parentheses to group. The table below lists every operator Google documents, with copy-paste examples.Most people use Gmail search like a web search: type a word, scroll, hope. Operators turn it into a precise filter. from:billing@example.com has:attachment after:2025/01/01 returns exactly one sender's emails with attachments since January 2025 — nothing else.
This cheat sheet is built from Google's own operator reference in Gmail Help: Refine searches in Gmail (checked September 28, 2026). On top of the raw list you get the gotchas that trip people up (dates, excluded conversations, Spam and Trash) and 12 ready-made searches for everyday business tasks.
Quick answer: the 10 operators you'll use most
If you only memorize ten, make it these. They cover the large majority of real searches: who sent it, when, what it was about, and whether it has a file.
| Operator | What it finds | Example |
|---|---|---|
from: | Emails sent by a person or address | from:amy@example.com |
to: | Emails sent to a person | to:me |
subject: | Words in the subject line | subject:invoice |
has:attachment | Emails with any attachment | has:attachment from:me |
filename: | Attachments by name or file type | filename:pdf |
after: / before: | Emails in a date range | after:2026/01/01 before:2026/04/01 |
older_than: / newer_than: | Relative dates (d, m, y) | newer_than:7d |
label: | Emails under one of your labels | label:clients |
is:unread | Status: unread, read, starred, important | is:unread is:important |
larger: | Emails above a size | larger:10M |
Full Gmail search operator reference
Every operator below appears in Google's official list. Descriptions are paraphrased; examples follow Google's syntax. Use this as the "Gmail search operators list" you can bookmark.
| Operator | What it does | Example |
|---|---|---|
from: | Sender. from:me = emails you sent | from:amy@example.com |
to: | Recipient in the To field | to:john@example.com |
cc: bcc: | Recipient in Cc or Bcc | cc:john@example.com |
subject: | Word or phrase in the subject | subject:(anniversary party) |
after: before: older: newer: | Received in a time period | after:2004/04/16 |
older_than: newer_than: | Older/newer than a period in d, m or y | older_than:1y |
OR or { } | Match any of several criteria | {from:amy from:david} |
AND | Match all criteria (a space does the same) | from:amy AND to:david |
- | Exclude a word or criterion | dinner -movie |
AROUND | Words within N words of each other | holiday AROUND 10 vacation |
label: | Emails under a label | label:friends |
category: | Inbox category (if you use categories): primary, social, promotions, updates, forums, reservations, purchases | category:purchases |
has: | Attachment, inline image, YouTube, Drive, Docs, Sheets, Slides | has:spreadsheet |
list: | Emails from a mailing list | list:info@example.com |
filename: | Attachment name or type | filename:homework.txt |
" " | Exact word or phrase | "dinner and movie tonight" |
( ) | Group terms | subject:(dinner movie) |
in:anywhere | Search everywhere, including Spam and Trash | in:anywhere movie |
in:archive | Archived messages | in:archive payment reminder |
in:snoozed | Snoozed emails | in:snoozed |
is:muted | Muted conversations | is:muted |
is: | important, starred, unread, read | is:starred |
has:yellow-star etc. | A specific star or icon (red-bang, green-check, blue-info…) | has:yellow-star OR has:purple-question |
deliveredto: | Delivered to a specific address (useful for aliases) | deliveredto:username@example.com |
size: larger: smaller: | Message size (bytes, or M for megabytes) | larger:10M |
+ | Match a word exactly | +unicorn |
rfc822msgid: | A specific Message-ID header | rfc822msgid:200503292@example.com |
has:userlabels has:nouserlabels | Messages with / without any of your labels | has:nouserlabels |
label:encryptedmail | Emails sent with client-side encryption | label:encryptedmail |
header: | A custom header or header value | header:X-Google-Calendar-Notification:rsvpWithNote |
Two operators people expect but won't find in Google's list: there is no "unanswered" or "no reply" operator, and no general wildcard. More on both below.
Search by date: after, before, older_than and newer_than
To search Gmail by date, use after: and before: with a date in YYYY/MM/DD format (Google also shows MM/DD/YYYY). after:2026/01/01 before:2026/02/01 returns January 2026. For rolling windows, use newer_than: or older_than: with d (days), m (months) or y (years): newer_than:30d is the last 30 days.
| You want | Type this |
|---|---|
| A single calendar year | after:2025/01/01 before:2026/01/01 |
| One quarter | after:2026/04/01 before:2026/07/01 |
| The last 7 days | newer_than:7d |
| Everything older than 2 years | older_than:2y |
| Between 6 and 12 months ago | older_than:6m newer_than:1y |
Tip: to cover a whole month, set before: to the first day of the next month rather than the last day of the current one. That avoids off-by-one surprises at the end of the range.
Why after: results can look off by a day
Google's Gmail API documentation states that "all dates used in the search query are interpreted as midnight on that date in the PST timezone", and that the query uses most of the same syntax as the Gmail web interface. If you are in Europe or Asia, an email received late on the evening of the boundary date may therefore land on the "wrong" side of your filter. The fix is simple: widen the range by one day on each side, then check the edges.
For exact cut-offs, the same page shows after: and before: accepting a Unix timestamp in seconds instead of a date (for example after:1388552400). That is documented for the API; if you try it in the search box, double-check the first and last results.
Search by size and find your biggest emails
Use larger: or smaller: with a number and M for megabytes — larger:10M finds every email over 10 MB. size: takes a number in bytes (size:1000000 is about 1 MB). Size includes attachments, so this is the fastest way to find what is eating your storage.
larger:20M— the true space hogs.larger:5M older_than:2y— big and old: usually safe to review for deletion.has:attachment larger:10M filename:zip— large zip files specifically.in:anywhere larger:10M— includes Spam and Trash, which also count toward storage until emptied.
Once you have the list, you can find and export your largest emails to a spreadsheet before you clean up, so you keep a record of what you deleted.
Combine operators: OR, NOT (-), parentheses and braces
A space between operators means AND: every condition must match. OR (in capitals) or curly braces mean "any of these". A minus sign excludes. Parentheses group terms so an operator applies to all of them.
| Logic | Syntax | Example |
|---|---|---|
| AND | space or AND | from:amy has:attachment |
| OR | OR or { } | from:amy OR from:david = {from:amy from:david} |
| NOT | - before a term | from:amazon -subject:shipped |
| Group | ( ) | subject:(invoice OR receipt) |
| Proximity | AROUND n | contract AROUND 5 renewal |
| Exact phrase | " " | "payment received" |
One gotcha Google itself documents: negative searches work on messages, not whole conversations. If you search -is:starred, a conversation can still appear when at least one message in it is unstarred. So if an excluded thread keeps showing up, open it — one message in the thread probably matches.
Does Gmail support wildcards?
No general wildcard is documented. Google's operator list has no * or ? operator, so invoice* will not reliably match "invoices" and "invoiced". The practical workaround is to list the variants with OR: subject:(invoice OR invoices OR invoiced). For senders, you can search part of an address, such as from:example.com, to catch everyone at one company.
12 ready-made Gmail searches for real work
Copy, paste, and swap in your own names and dates. Each one uses only operators from Google's official list.
| # | Task | Search |
|---|---|---|
| 1 | Receipts and invoices from last year | subject:(receipt OR invoice) after:2025/01/01 before:2026/01/01 |
| 2 | Purchase emails (if categories are on) | category:purchases newer_than:1y |
| 3 | Everything from one company | from:example.com |
| 4 | Your sent emails to one client | from:me to:client@example.com |
| 5 | PDF invoices from a supplier | from:billing@supplier.com filename:pdf |
| 6 | Attachments over 10 MB | has:attachment larger:10M |
| 7 | One newsletter, all issues | list:news@example.com |
| 8 | Unread for more than a month | is:unread older_than:1m |
| 9 | Archived mail you never labeled | in:archive has:nouserlabels |
| 10 | Mail sent to a +alias you gave a shop | deliveredto:you+shop@gmail.com |
| 11 | A reference number anywhere, even Trash | in:anywhere "ORD-48213" |
| 12 | Shared spreadsheets from your team | has:spreadsheet from:yourcompany.com newer_than:6m |
A few notes on these recipes:
- #2 depends on categories. Google notes
category:works "if you use inbox categories". If it returns nothing, use recipe #1. - #3 and #12 search part of an address. Replace
example.comwith the domain after the @. - #9 is label-per-message. Google says labels are added to messages, not whole conversations, so a thread can show up even if you labeled one reply.
- "Unanswered emails" has no operator. A common approximation is
is:unreadplus a date range, but it won't catch emails you read and forgot to answer.
Need every email from one person rather than one company? See how to export every email from one sender, combining from: with the operators above.
Saving a search: filters and labels
Gmail has no "saved searches" list, but a filter does the same job. Run your search, open the search options (the sliders icon in the search box), and click Create filter. Then choose an action — for example "Apply the label" — so future matching emails are labeled automatically, as described in Gmail Help: Create rules to filter your emails.
- Type the search and press Enter to check the results look right.
- Click Show search options, then Create filter.
- Tick Apply the label and pick or create a label.
- Click Create filter. From then on,
label:yourlabelis your saved search.
Keep in mind that some filter actions only affect new messages (Google notes this for forwarding). You can also export your filters as an .xml file from Settings → Filters and Blocked Addresses to back them up or move them to another account.
Search on the Gmail app and in Spam or Trash
Operators are not desktop-only. Google's Search in Gmail help shows operators such as after:2025/01/01 before:2025/05/01 and has:attachment in the Android app search box too. The app also offers search chips (Label, From, To, Attachment, Date) for the common cases.
By default, standard searches skip Spam and Trash. Add in:anywhere to include them, or choose "Mail & Spam & Trash" in the advanced search panel.
Found the right emails? Export exactly those results.
Turn any Gmail search into a CSV in one click — free, generated locally in your browser.
Add to Chrome — It's FreeTurn any search into a spreadsheet
A good search is often the first half of a job: you want the list of receipts for your accountant, every lead from a web form, or all emails with one supplier. Gmail can show them but can't hand you a table.
That is the gap the Gmail Exporter extension fills. Run your search, open the extension, and export the emails in view:
- Type your operator search in Gmail (for example
subject:(receipt OR invoice) newer_than:1y). - Open Gmail Exporter and remove duplicate rows if needed.
- Export to CSV. The free plan includes email address, subject, a body preview and the sending service; dates, sent/received direction and names come with Pro, alongside Excel and JSON output.
For a full walkthrough, see how to export your Gmail search results to CSV, or how to export emails by date range when the date is what matters. Searching for old sign-up and "welcome" emails is also the fastest way to find every account linked to your email.
Common reasons a search misses emails
- Spam and Trash are excluded. Add
in:anywhere. - The date boundary. Dates are read as midnight in one time zone (see above). Widen by a day.
- Plurals and word forms. No wildcard: list the variants with OR.
- The word is only in an attachment name. Use
filename:instead of a plain keyword. - Negative searches and threads. Exclusions work message by message, so whole conversations can reappear.
- Offline. Google notes that without a connection you can only search emails synced to your device.
Frequently asked questions
Why doesn't my Gmail search return everything?
The usual causes: Spam and Trash are excluded unless you add in:anywhere; date boundaries are read as midnight in one time zone, so widen the range by a day; there is no wildcard, so plurals need OR; and negative searches work per message, so whole threads can reappear.
Can I search Gmail by time of day?
Not with calendar dates — after: and before: work on whole days. Google's Gmail API documentation shows after:/before: also accepting a Unix timestamp in seconds for exact cut-offs; if you use it in the search box, check the first and last results.
Is Gmail search case-sensitive?
Google's help doesn't state case rules for keywords. Write the logic words OR, AND and AROUND in capitals, exactly as Google's examples do, so Gmail reads them as operators rather than as words to find.
Do Gmail search operators work in the mobile app?
Yes. Google's Search in Gmail help shows operators such as after:, before: and has:attachment in the Android app search box, alongside search chips for label, sender, attachment and date.
How do I save a Gmail search?
Gmail has no saved-search list. Run the search, open search options, click Create filter and choose Apply the label. The label then works as a saved search, and new matching emails are labeled automatically.