Skip to main content

CMDK (formerly Simplehuman) | Supercharge your Gmail

🚨 Simplehuman is now CMDK   |   New name. Same mission.  Read More.

Gmail Search Operators: The Cheat Sheet and a Builder That Writes the Query for You

Gmail’s search bar accepts a query language that most people never use. from:stripe has:attachment after:2026/01/01 finds the invoice in two seconds; scrolling finds it in ten minutes. The operators are not hard, there are just more of them than anyone remembers.

This page has both fixes: a builder that writes the query from a form, and the cheat sheet for when you want to type it yourself.

Build your search

Fill in what you know, copy the query, or run it in Gmail directly.

Fill in a field above to build your search
Run in Gmail Copied to clipboard
Paste into Gmail’s search bar, or hit Run in Gmail to open the search directly. Runs entirely in your browser; nothing you type here is sent anywhere.

The operators worth memorizing

These eight cover almost every real search:

  • from: and to: match sender and recipient. A name fragment works: from:amazon catches every Amazon address.
  • subject: matches the subject line only.
  • after: and before: take dates as YYYY/MM/DD.
  • older_than: and newer_than: take relative periods: older_than:1y, newer_than:2d. Units are d, m, and y.
  • has:attachment limits results to emails with files attached.
  • larger: and smaller: filter by size: larger:10M finds the storage hogs.
  • is: filters by state: is:unread, is:starred, is:important.
  • in: and category: pick the location: in:spam, in:sent, category:promotions.

Combining operators

Operators separated by spaces are ANDed together, so from:stripe has:attachment means both conditions. Four more combinators cover the rest:

  • OR (capitals required) matches either side: from:stripe OR from:paypal
  • The minus sign excludes: dinner -movie finds emails with “dinner” but not “movie”
  • Curly braces are an alternative OR: {from:stripe from:paypal}
  • Parentheses group words for one operator: subject:(quarterly report) requires both words in the subject

Exact phrases go in quotes: "out for delivery" matches those words in that order.

Searching by date

Two ways, depending on what you know:

  • Absolute dates use after: and before: with YYYY/MM/DD: after:2026/01/01 before:2026/02/01 is January 2026.
  • Relative periods use older_than: and newer_than:: newer_than:7d is the last week, older_than:1y is everything before last July.

The relative forms are what make cleanup searches reusable: category:promotions older_than:6m means “old promotions” forever, no date math required.

Searches worth saving

  • larger:10M older_than:1y finds old large emails, the fastest storage win
  • has:attachment filename:pdf from:me finds every PDF you have sent
  • is:unread older_than:1m in:inbox finds the unread pile you are never going to read
  • from:noreply older_than:6m finds stale automated mail, safe to delete wholesale
  • to:me -in:chats is:unread newer_than:2d finds what actually needs attention today

The cleanup searches feed directly into bulk actions; our guide to mass deleting emails in Gmail covers the select-all-and-delete step.

Frequently asked questions

How do I search Gmail by date range?

Use after: and before: with dates in YYYY/MM/DD format, for example after:2026/01/01 before:2026/02/01 for January 2026. For relative ranges, use newer_than: and older_than: with d, m, or y units, like newer_than:7d for the past week.

How do I search Gmail for emails with attachments?

Use has:attachment, and narrow by type with filename:, for example has:attachment filename:pdf. To find large attachments, add a size filter like larger:5M.

Can I search Gmail for exact phrases?

Yes. Put the phrase in double quotes: “quarterly board review” matches those words in that order. Without quotes, Gmail matches emails containing all the words anywhere.

How do I exclude words from a Gmail search?

Put a minus sign directly before the word or operator: dinner -movie, or from:amazon -subject:(order confirmation). The minus works on any operator, not just words.

Does Gmail search look inside attachments?

Yes, for common formats. Gmail indexes the text of PDFs and Office documents, so searching a phrase can match an email where the phrase only appears in the attached file.

One more shortcut: press / and Gmail focuses the search bar, no mouse needed. CMDK takes the same idea further with a Cmd+K command bar that searches, archives, snoozes, and labels from the keyboard.

Supercharge your Gmail

Install the extension in seconds to get to inbox zero faster

More from the Blog

gmail reminder

Gmail Reminders: How to Set Follow-Up Reminders That Actually Work

bulk unsubscribe gmail

How to Unsubscribe From Emails in Gmail (Bulk, the Easy Way)

be faster in gmail with Simplehuman

How to Use Keyboard Shortcut for “Archive” in Gmail and more with CMDK

superhuman price

Superhuman Price Too High? Here’s Why CMDK Delivers Better Value

How to Block and Delete All Emails from Annoying Senders

How to Block and Delete All Emails from Annoying Senders

Gmail Keyboard Shortcuts: A Friendly 2026 Guide to Moving Faster

Supercharge your Gmail

Simplehuman Logo Install CMDK

CMDK works on the desktop browser. Enter your email below, and we will send you a link to install CMDK when you are on your computer.