Home › Blog › Gmail search operators

Gmail Search Operators: The Complete Cheat Sheet

Published September 28, 2026 · 11 min read
Filter & search
Filter & search
Gmail Exporter Guide
Gmail search operators are short commands you type into the Gmail search box to filter mail precisely — for example 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.

OperatorWhat it findsExample
from:Emails sent by a person or addressfrom:amy@example.com
to:Emails sent to a personto:me
subject:Words in the subject linesubject:invoice
has:attachmentEmails with any attachmenthas:attachment from:me
filename:Attachments by name or file typefilename:pdf
after: / before:Emails in a date rangeafter: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 labelslabel:clients
is:unreadStatus: unread, read, starred, importantis:unread is:important
larger:Emails above a sizelarger: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.

OperatorWhat it doesExample
from:Sender. from:me = emails you sentfrom:amy@example.com
to:Recipient in the To fieldto:john@example.com
cc: bcc:Recipient in Cc or Bcccc:john@example.com
subject:Word or phrase in the subjectsubject:(anniversary party)
after: before: older: newer:Received in a time periodafter:2004/04/16
older_than: newer_than:Older/newer than a period in d, m or yolder_than:1y
OR or { }Match any of several criteria{from:amy from:david}
ANDMatch all criteria (a space does the same)from:amy AND to:david
-Exclude a word or criteriondinner -movie
AROUNDWords within N words of each otherholiday AROUND 10 vacation
label:Emails under a labellabel:friends
category:Inbox category (if you use categories): primary, social, promotions, updates, forums, reservations, purchasescategory:purchases
has:Attachment, inline image, YouTube, Drive, Docs, Sheets, Slideshas:spreadsheet
list:Emails from a mailing listlist:info@example.com
filename:Attachment name or typefilename:homework.txt
" "Exact word or phrase"dinner and movie tonight"
( )Group termssubject:(dinner movie)
in:anywhereSearch everywhere, including Spam and Trashin:anywhere movie
in:archiveArchived messagesin:archive payment reminder
in:snoozedSnoozed emailsin:snoozed
is:mutedMuted conversationsis:muted
is:important, starred, unread, readis: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 headerrfc822msgid:200503292@example.com
has:userlabels has:nouserlabelsMessages with / without any of your labelshas:nouserlabels
label:encryptedmailEmails sent with client-side encryptionlabel:encryptedmail
header:A custom header or header valueheader: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 wantType this
A single calendar yearafter:2025/01/01 before:2026/01/01
One quarterafter:2026/04/01 before:2026/07/01
The last 7 daysnewer_than:7d
Everything older than 2 yearsolder_than:2y
Between 6 and 12 months agoolder_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.

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.

LogicSyntaxExample
ANDspace or ANDfrom:amy has:attachment
OROR or { }from:amy OR from:david = {from:amy from:david}
NOT- before a termfrom:amazon -subject:shipped
Group( )subject:(invoice OR receipt)
ProximityAROUND ncontract 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.

#TaskSearch
1Receipts and invoices from last yearsubject:(receipt OR invoice) after:2025/01/01 before:2026/01/01
2Purchase emails (if categories are on)category:purchases newer_than:1y
3Everything from one companyfrom:example.com
4Your sent emails to one clientfrom:me to:client@example.com
5PDF invoices from a supplierfrom:billing@supplier.com filename:pdf
6Attachments over 10 MBhas:attachment larger:10M
7One newsletter, all issueslist:news@example.com
8Unread for more than a monthis:unread older_than:1m
9Archived mail you never labeledin:archive has:nouserlabels
10Mail sent to a +alias you gave a shopdeliveredto:you+shop@gmail.com
11A reference number anywhere, even Trashin:anywhere "ORD-48213"
12Shared spreadsheets from your teamhas:spreadsheet from:yourcompany.com newer_than:6m

A few notes on these recipes:

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.

  1. Type the search and press Enter to check the results look right.
  2. Click Show search options, then Create filter.
  3. Tick Apply the label and pick or create a label.
  4. Click Create filter. From then on, label:yourlabel is 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 Free

Turn 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:

  1. Type your operator search in Gmail (for example subject:(receipt OR invoice) newer_than:1y).
  2. Open Gmail Exporter and remove duplicate rows if needed.
  3. 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

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.