Postage

Gmail search operators: build a search with a form

Fill in the fields and the tool writes the Gmail search for you, such as from:amy@example.com has:attachment older_than:1y. Paste it in the Gmail search box, or press Open in Gmail.

People

Several addresses, separated by commas, match any of them.

Words

Words to leave out, separated by spaces.

Attachments

For example pdf, xlsx or report.docx.

Where

Spaces become hyphens, as Gmail expects.

Size and date
Open in Gmail

Open in Gmail goes to your own mailbox. Nothing you type here is sent to us.

Operator cheat sheet

OperatorFindsExample
from:Senderfrom:amy@example.com
to: cc: bcc:Recipientsto:team@example.com
subject:Words in the subjectsubject:(quarterly report)
"..."Exact phrase"purchase order"
-Leave out a word-newsletter
{ }Match any of the terms (OR){from:amy from:bob}
has:attachmentHas a file attachedhas:attachment
filename:Attachment name or typefilename:pdf
label: in:Label or mailboxin:sent
in:snoozedSnoozed mailin:snoozed
is:Unread, starred, importantis:unread
larger: smaller:Message size (M, or plain bytes)larger:10M
after: before:Date rangeafter:2025/01/01
older_than: newer_than:Relative age (d, m, y)older_than:2y
category:Inbox tabcategory:promotions

How to use it

  1. Fill in only the fields you need. Each one adds one operator, and empty fields add nothing.
  2. Enter several senders separated by commas to match any of them. The tool groups them as {from:a from:b}.
  3. Check the search in the box. A warning appears when two limits cannot both be true, such as an After date later than the Before date.
  4. Press Copy search and paste it into Gmail, or press Open in Gmail to run it in your own mailbox.

Rules Gmail follows that trip people up

Gmail combines terms with AND by default. To match either of two terms, wrap them in braces, {from:amy from:bob}, or write OR in capitals between them. A minus sign in front of a word, -newsletter, leaves it out.

older_than: and newer_than: take a number and a unit: d for days, m for months, y for years. after: and before: take a date written 2025/01/31. Sizes take M for megabytes, as in larger:10M, or a plain number of bytes, as in smaller:500000.

Label names with spaces are written with hyphens, so a label called Client Work is searched as label:client-work. Searches skip spam and trash unless you add in:anywhere, and snoozed mail has its own in:snoozed.

Excluding words counts per message, not per conversation

Gmail shows conversations, but it matches messages. A search like -is:starred can still list a starred thread when one message in it is not starred, and -newsletter keeps a thread if any reply leaves the word out. Open the thread to see which message matched.

When you need the exact opposite of a search, put the minus sign in front of the operator itself: -has:attachment or -from:amy@example.com. Several exclusions can sit side by side, and each one narrows the result further.

Questions

How do I find large emails in Gmail?

Use larger: with a size, for example larger:10M for messages over 10 MB. Add has:attachment to narrow it to files, and older_than:1y to find old ones worth deleting.

How do I search Gmail for emails from one of several people?

Put the senders in braces: {from:amy@example.com from:bob@example.com}. You can also write from:amy@example.com OR from:bob@example.com, with OR in capitals.

What is the difference between older_than and before?

older_than: counts back from today, as in older_than:6m. before: takes a fixed calendar date, as in before:2025/06/01. Use the relative form in a filter or bookmarked search that should keep moving with the calendar.

Why does my Gmail search miss messages in spam or trash?

Gmail leaves spam and trash out of normal searches. Add in:anywhere to include them, or in:spam or in:trash to search just one.

Does this tool see my email?

No. It only assembles text in your browser. The Open in Gmail button opens a link to your own Gmail, and the search runs there.

Search your whole mailbox from your Mac

Postage is a native Mac email client for Gmail, iCloud, Fastmail and any IMAP account, with one unified inbox, Spotlight search for your mail, and a built-in MCP server on your Mac so your agent can search, sort and draft replies. See Postage or the price.

More free tools