Gmail filters automatically sort, label, and organize your incoming mail based on rules you create

A Gmail filter is a set of instructions that tells Gmail what to do with emails matching certain conditions. You can filter by sender, subject line, words in the message, file attachments, or size. Once you set up a filter, Gmail applies it automatically to all new incoming mail — and optionally to messages already in your inbox.

The most common use is moving emails to a label (Gmail's version of folders), but filters can also mark messages as read, star them, delete them, or send them to spam. You create filters in Gmail's settings, and they work on any device where you check your email.

Key Takeaways

  • Open Gmail settings, go to the Filters and Blocked Addresses tab, and click Create a new filter to start.
  • Choose what to filter by — sender address, subject words, or content — then decide what Gmail should do with matching emails.
  • You can apply a filter to emails already in your inbox, or only to new messages arriving from that point forward.
  • Test a filter on a small group of emails first before applying it to thousands of old messages.
  • Delete or edit filters anytime from the same Filters and Blocked Addresses tab in settings.

How to create a filter from scratch

Start in Gmail on a computer (filters work the same way on phone and tablet, but the steps are slightly different). Click the gear icon in the top right, then select See all settings. Go to the Filters and Blocked Addresses tab.

Click Create a new filter at the bottom of the page. A box will open with fields for From, To, Subject, Has the words, Doesn't have, Size, and Date within. Fill in only the fields that match what you want to filter. For example, if you want to filter all emails from your manager, type their email address in the From field. If you want to catch emails about a specific project, type keywords in the Has the words field.

Click Create filter at the bottom right. Gmail will show you a preview of how many emails match your criteria. Then it asks what you want to do with these messages. Check the box next to your chosen action — most commonly Apply label (to sort into a folder), Skip the inbox (to archive automatically), or Delete it. You can pick multiple actions at once.

At the bottom, check Also apply filter to matching conversations if you want Gmail to apply this rule to emails already in your inbox. Leave it unchecked if you only want it to affect new mail from now on. Click Create filter to finish.

Filtering by sender or recipient

The simplest filter catches all mail from one person or domain. In the From field, type the full email address (like boss@company.com) or just the domain (like @company.com) to catch everyone at that organization. This is useful for grouping work emails, newsletters, or notifications from a specific service.

You can also filter by the To field — for instance, if you have a shared inbox or mailing list address. Type that address in the To field, and the filter will catch only emails sent to that specific recipient. This works well if you receive mail at multiple addresses and want to organize them differently.

If you want to exclude someone, use the Doesn't have field instead. Type a sender's address there, and the filter will skip anyone matching that address. This is less common but useful if you want to filter a broad group but exclude one person.

Filtering by subject line or message content

Use the Subject field to catch emails with specific words in the subject line. Type keywords like invoice, receipt, or project name. Gmail will match any email whose subject contains those words, in any order.

The Has the words field searches the entire email body, not just the subject. This catches emails mentioning a topic anywhere in the message. You can type multiple words separated by spaces, and Gmail will match emails containing any of those words. To match an exact phrase, put it in quotes — for example, "quarterly report" will only match emails with those two words together.

The Doesn't have field lets you exclude emails containing certain words. This is useful if you want to filter a broad category but skip messages about a specific subtopic. For example, you could filter all emails with the word "meeting" but exclude those also containing "cancelled".

Filtering by attachments and message size

Check the Has attachment box to filter only emails with files attached. This is useful if you want to automatically label or archive emails with documents, images, or other files. Leave it unchecked if attachment status doesn't matter.

The Size field lets you filter by message size in bytes. This is rarely needed, but it can help catch unusually large emails or spam. Most users skip this field entirely.

What to do with filtered emails

After you define what to filter, Gmail asks what action to take. Apply label is the most common choice — it sorts matching emails into a folder you create or select. You can create a new label right from this menu by typing a name. Labels can be nested (like Work > Projects > Client A) to organize hierarchically.

Skip the inbox automatically archives matching emails so they don't clutter your inbox, but you can still find them by searching or looking in the All Mail folder. Mark as read prevents new messages from showing as unread. Star it adds a star icon so important emails stand out. Delete it sends matching emails straight to trash — use this carefully, as it bypasses your inbox entirely.

You can combine multiple actions. For example, you could apply a label and skip the inbox and mark as read on the same filter. This is useful for newsletters or notifications you want to keep but don't need to see immediately.

Testing a filter before applying it to old emails

Before you check Also apply filter to matching conversations, create the filter and let it run on new mail for a day or two. This way you can see if it's catching what you intended without accidentally sorting thousands of old emails incorrectly.

To test, go back to Filters and Blocked Addresses, find your new filter, and click the down arrow next to it. Select Show matching conversations to see a preview of what it would catch. If the preview looks wrong, click the down arrow again and select Edit to adjust your criteria. Once you're confident it's working, edit the filter again and check Also apply filter to matching conversations, then click Update filter.

Editing and deleting filters

To change a filter you've already created, go to Settings, then Filters and Blocked Addresses. Find the filter in the list, click the down arrow next to it, and select Edit. Make your changes and click Update filter. The new rule applies to all future emails immediately, but it won't change how the filter treated emails before you edited it.

To remove a filter entirely, click the down arrow and select Delete. Gmail will ask you to confirm. Deleting a filter does not delete any emails — it just stops the rule from running on new mail. Emails that were already labeled or archived by that filter stay where they are.

Frequently Asked Questions

Can I filter emails on my phone or tablet?

Gmail's mobile apps don't have a filters menu, so you must create and edit filters on a computer. However, once you set them up, they work automatically on all your devices. You can view and manage filters by opening Gmail in a mobile browser and going to settings, but the desktop site is easier to use.

What happens if two filters match the same email?

Gmail applies all matching filters in the order you created them. If one filter labels an email and another archives it, both actions happen. If two filters try to apply different labels, both labels get added. This is usually helpful, but if you want only one filter to run, you can edit the second filter to exclude emails already caught by the first.

Can I filter emails by date?

Yes, the Date within field lets you filter emails received in the last number of days, months, or years. This is useful for organizing old mail — for example, you could filter all emails from the last year and apply a label to them. However, this filter only runs once when you create it; it doesn't automatically update as time passes.

Will a filter affect emails I've already read?

Only if you check Also apply filter to matching conversations. If you don't check that box, the filter only affects new emails arriving after you create it. Existing emails stay in your inbox or wherever they are unless you manually move them.

What's the difference between a filter and a search?

A search finds emails matching your criteria right now, but it doesn't organize them or change how Gmail handles them. A filter automatically organizes all future emails matching your criteria. Filters run in the background without you doing anything; searches require you to type something each time.