Skip to content
ToolsMay 9, 2026By dreamif.ai

Gmail search query builder

Build Gmail search syntax without memorizing operators. Choose senders, dates, attachments, unread status, excluded words, and more, then copy the exact query.

Build a Gmail search

Try an example
People
Content
Filters
Gmail query

Gmail operators this builds

The builder covers common Gmail search operators: from:, to:, subject:, after:, before:, older_than:, newer_than:, has:attachment, exclusions, and grouped senders.

The operator set follows Google's Gmail search operator documentation.

Common recipes

A few search patterns that come up often. Copy them straight into Gmail, or rebuild them in the tool above to tweak the values.

  • Every attachment from one sender, older than a year: from:amy@example.com has:attachment older_than:1y
  • Unread mail from any of two people: {from:amy@example.com from:david@example.com} is:unread
  • Invoices that are PDFs but not internal drafts: filename:pdf invoice -subject:draft
  • Anything you sent containing a follow-up phrase: from:me "following up"
  • Large attachments hiding in any folder, including spam and trash: has:attachment larger:10M in:anywhere
  • Mail in a specific window: after:2026/01/01 before:2026/02/01

Tips that aren't obvious

  • Multiple senders need brace syntax. Comma-separating from: values does not work; the builder rewrites them as {from:a@example.com from:b@example.com} automatically.
  • older_than: is relative to today, while before: is an absolute date. Use the relative form for evergreen searches you save.
  • Excluding a phrase is a leading dash: -subject:newsletter or -receipt. Multi-word phrases need quotes.
  • Gmail search ignores common words and punctuation. If a query feels too loose, add a quoted phrase like "thank you" to anchor it.
  • To include archived, spam, and trash in the same search, turn on All mail — it adds in:anywhere, which most other operators silently exclude.
dreamif.ai
Explore

Related resources

Frequently Asked Questions

Email that runs itself.