Free tool

Gmail filter builder

Type who or what to catch, pick what happens, and download a filter you can import into Gmail.

One per line: senders, domains or words. Email matching any line gets caught.

What should Gmail do?

Your Gmail search

Your search shows up here.

Paste it into Gmail search to see what it catches.


Your filter file

Add a sender, domain or word to start.


Import it into Gmail

  1. Open Gmail on a computer. Click Settings (the gear), then See all settings.
  2. Open the Filters and Blocked Addresses tab.
  3. At the bottom, click Import filters. Choose mailFilters.xml and click Open file.
  4. Want it to sort email you already have? Tick Apply new filters to existing email.
  5. Click Create filters.

Import steps checked against Gmail Help: Create rules to filter your emails.

Good to know

How do I block emails on Gmail?

Open an email from the sender, click the three dots at the top right, and choose Block. Gmail sends their future email to Spam. To block a whole domain, or send it straight to Trash, build a filter above and pick Delete it.

Step-by-step: how to block emails on Gmail

How do I create a filter in Gmail by hand?

Paste your search into the Gmail search bar and click Show search options at its right end. Click Create filter, tick what should happen, then click Create filter again.

Does this tool see my email?

No. It never connects to Gmail. What you type stays in your browser, and the file is made on your device.

More free tools and guides