Free Gmail filter and search builder

This free Gmail filter builder writes the search for you. Fill in a sender, words, size, age or category, then copy the search, open it in Gmail, or download a mailFilters.xml file that Gmail imports as a filter. It runs in your browser: no sign-in, and nothing you type is sent anywhere.

Updated .Free. No sign-in. Works on a phone or a computer.

Import the filter into Gmail

  1. In Gmail on a computer, click the gear icon at the top right, then See all settings.
  2. Open the Filters and Blocked Addresses tab.
  3. At the bottom of the page, click Import filters, choose the mailFilters.xml file you downloaded, and click Open file.
  4. Click Create filters.

Filters act on new mail. Gmail runs a filter on each email as it arrives, so mail already in your account is left alone. To include it, tick Apply new filters to existing email on the import screen before you click Create filters. When you make a filter by hand, the same choice reads Also apply filter to matching conversations.

That is also why "Older than" and "Is unread" stay out of the filter file: a new email is never old and always unread. Use those two in the search. Importing works in Gmail on a computer, not in the phone app.

How Gmail search operators work

Type these into the search box at the top of Gmail. Put a space between operators to require all of them.

OperatorWhat it findsExample
from:Email from a sender or a whole domainfrom:example.com
to:Email sent to an addressto:you+shopping@gmail.com
subject:Words in the subject linesubject:invoice
" "An exact phrase"order confirmation"
OR or { }Any one of several things{from:amy@example.com from:david@example.com}
-Leaves something outunsubscribe -receipt
( )Groups words so one operator covers all of themsubject:(dinner movie)
has:attachmentEmail with a file attachedhas:attachment from:example.com
larger: smaller:Email over or under a size. M is megabytes, K is kilobyteslarger:10M
older_than: newer_than:Age in days (d), months (m) or years (y)older_than:1y
category:One inbox category: primary, promotions, social, updates or forumscategory:promotions
is:unreadEmail you have not openedis:unread older_than:6m

Source: Google's Gmail Help page on search operators, read November 14, 2026.

Or let Inbox Hero do this

Inbox Hero is an AI email assistant for Gmail, Yahoo, AOL, iCloud and other IMAP mailboxes that sorts new mail into folders, checks every new email for scams and phishing, and drafts replies in your voice.

  • No filters to write. New mail is sorted into Fraud, Later, Newsletters, Notifications and Shopping folders as it arrives, and the backlog is filed too.
  • Your own rules in a tap. Block a sender, or choose Always file like this to send their mail to a folder.
  • Every new email is checked for scams and phishing. Clear scams go to the Fraud folder.

27¢ a day ($99 a year) after a 14-day free trial: $0 today, card at sign-up, cancel any time.

Frequently asked questions

Is the Gmail filter builder free?

Yes. It is free and needs no sign-in. It runs in your browser, so the senders and words you type are not sent to Inbox Hero or anyone else.

What is the difference between a Gmail search and a filter?

A search finds email you already have. A filter is a saved search plus an action, such as Skip the Inbox or Delete it, that Gmail runs on each new email that matches.

Can a Gmail filter delete old emails?

Not by age. A filter runs on each email as it arrives, so "older than" cannot be part of one. To delete old mail, copy the search, open it in Gmail, select all conversations that match and click Delete.

How do I import a filter file into Gmail?

In Gmail on a computer, open Settings, then See all settings, then Filters and Blocked Addresses. At the bottom, click Import filters, choose the mailFilters.xml file, click Open file, then Create filters.

How do I search for several senders at once in Gmail?

Put them in braces, like {from:amy@example.com from:david@example.com}, or write OR in capital letters between them. The builder does this for you when you separate senders with commas.

Will the filter change email I already have?

Only if you ask it to. Filters act on new mail. On the import screen, tick Apply new filters to existing email if you want the same action on matching mail already in your account.

Security and privacy

Reviewed by Google. Tested by an independent lab.

Before you connect Gmail, here is what keeps your inbox safe with us, in plain words.

Portrait of Mike Jones

Trusted by Mike Jones and Science Inc., the team behind Dollar Shave Club

“I built Inbox Hero for my own inbox and use it every day. I’d never ask you to trust it with yours if I didn’t.”

Mike Jones
Founder and CEO, Science Inc. Former CEO, Myspace.

Track record

  • Science Inc.Founder and CEO
  • Dollar Shave ClubBuilt at Science
  • Liquid DeathEarly investor
  • MyspaceFormer CEO

Science is the Los Angeles studio and venture firm behind Dollar Shave Club and an early investor in Liquid Death.

Available on the App Store for iPhone Read our privacy policy