Skip to content

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.

Updated Free to use

Build a Gmail search

Start with a preset
People
Content
Filters
Gmail query

When a built query beats manual search

Gmail's search bar is fast when you remember the exact words in a thread. Operators help when you know the shape of the email but not the phrase: who sent it, when it arrived, whether it had a PDF, or which folder might contain it.

Before a call
Find every attachment from a client.
Billing cleanup
Pull old invoices or contracts without opening every billing thread.
Inbox triage
Find unread mail from several people at once.
Missing thread
Search archived, spam, and trash when normal inbox search misses it.
Account handoff
Build repeatable searches for cleanup work or follow-up review.

The builder does not read your mailbox. It creates the search text, then Gmail runs the query after you paste it or open the generated URL.

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

This builds a search string you can paste into Gmail. It does not connect to your account, run the search, or change anything in your mailbox.

  • 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.

When a search is one you'll keep running, the same newsletters, the same sender, the same size threshold, a Gmail filter applies it to new mail on its own instead of waiting for you to search again. This builder's sibling, the Gmail filter XML generator, turns the same conditions into an importable filter file.

Questions, answered.

None. It runs entirely in your browser, with no dreamif.ai account and nothing to install.

More inTools

Related resources

Inbox & setup7 min read

How to Set Up and Use Gmail Multiple Inboxes

You can turn on Gmail Multiple inboxes on a computer and create up to five sections.

Match
fromnewsletters@example.com
subjectweekly digest
Then do
Skip inboxNewsletters
mailFilters.xml
<apps:property name='shouldArchive'
<apps:property name='label'
ToolsFree tool

Build several Gmail filters at once

Build several Gmail filters on one page, review the rules together, and download one file to import them into Gmail.

AI assistants5 min read

What a Gmail email assistant should actually help with

Does Gmail's built-in Gemini AI already cover your email, or do you need more? What Help me write handles, where it falls short, and when to add a layer.

ToolsFree tool

AI email response generator

Free AI email response generator: paste the email you received, say what the reply should do, and get a grounded, ready-to-edit draft in a tone that fits.

Mail merge preview
1 issue

Template

Hi {{first_name}},

Quick idea for {{company}}.

Hi Sarah, Quick idea for Acme.

Hi , Quick idea for N/A.

Empty value
ToolsFree tool

Mail merge preview tool

Paste your template and CSV. Preview the first 20 merged emails instantly and catch broken variables, empty fields, placeholder values, and unused columns.

SPF
pass
DKIM
pass
DMARC
pass
send-workermail.relay
origin
mail.relaymx.inbox
+2s
mx.inboxdelivered
+1s
ToolsFree tool

Email header analyzer for delivery delays

Paste raw email headers to reorder the delivery path, find hop delays and sender-domain differences, and inspect recorded authentication results.

Email that keeps moving.