To auto label emails in Gmail, turn a search into a filter: search for the emails you want, open the search options, click Create filter, tick Apply the label, choose a label and click Create filter again. Gmail then labels every new message that matches, the moment it arrives. Tick "Also apply filter to matching conversations" before you save, and it labels the ones already in your inbox too.
Filters are free and exact, and that is also their limit. A filter matches words and addresses, not meaning: it can catch every email with "invoice" in the subject, but not every email that wants you to pay something. Below are the steps, ready-made queries for the labels most people want, the limits Google documents but almost nobody mentions, and the point where an AI label does the job better.
Pick your conditions in the generator below and it writes the exact query to paste into Gmail.
Matches emails from this address.
Matches emails sent to this address.
Emails with these words in the subject line.
Emails containing these words anywhere. Multiple words = AND logic.
Exclude emails containing these words.
Set at least one condition above to see how to create the filter.
What this Gmail filter generator does
This tool converts your filter conditions into the exact search syntax Gmail uses to match messages. Instead of memorizing operators like from:, subject:, and has:attachment, you pick your criteria from the form and get a ready-to-use query plus step-by-step setup instructions.
from: — Sender email
to: — Recipient email
subject: — Words in subject
has:attachment — With file
larger: smaller: — Size
newer_than: older_than: — Date
✦ Auto-label invoices from your accounting system
✦ Skip the inbox for shipping notifications
✦ Mark read for newsletters you never open
✦ Delete emails from known spammy senders
✦ Star emails from your manager with “urgent” in the subject
✦ Categorize receipts and expense reports
Key Takeaways
- A Gmail filter is a saved search. Whatever the search finds today is what the filter will label from now on, so test the query in the search bar before you save it.
- One filter applies one label. Gmail allows "only one user-defined label" per filter (Google for Developers, 2026), so two labels need two filters.
- An account can hold at most 1,000 filters (Gmail API reference, 2026).
- Filters act on new mail. For mail you already have, tick Also apply filter to matching conversations, or search, select everything and label it by hand.
- Filters match words, not meaning. When a label depends on what an email asks of you, such as Action Needed, a rule can't tell the difference and an AI label can.
How to Auto Label Emails in Gmail, Step by Step
These steps are for Gmail in a browser on a computer, which is where Google documents filters (Google Help, 2026). The labels a filter applies show up in the Gmail app too.
- Search for the emails. Type into the search bar at the top, or click Show search options (the sliders icon at the right of the bar) and fill in From, To, Subject or Has the words.
- Check the results. The list Gmail shows is exactly what the filter will catch. If something wrong is in it, tighten the search now. The operators in the next section help.
- Click Create filter at the bottom of the search options panel.
- Tick Apply the label and choose a label, or pick New label… to create one on the spot.
- Decide whether it skips the inbox. Ticking Skip the Inbox (Archive it) as well makes the label behave like a folder: the email lands under the label and never in your inbox. Leave it unticked if you still want to see it arrive.
- Tick Also apply filter to matching conversations to label what's already in your mailbox.
- Click Create filter.
To change or remove a filter later, open Settings, then See all settings, then Filters and Blocked Addresses, and click Edit or Delete next to it. The same page exports your filters as an XML file and imports them into another account (Google Help, 2026).
Gmail Filter Queries for the Labels Most People Want
Every operator below works inside a filter, because each one describes the message itself rather than what has happened to it since. Paste a query into the search bar, check what it finds, then create the filter. The operators come from Google's Gmail search operators page.
| Label | Query | What to watch for |
|---|---|---|
| Receipts | subject:(receipt OR invoice OR "order confirmation") | Misses receipts with other subjects, such as "Your order has shipped" |
| One client | from:clientdomain.com | Catches everyone at that company, their newsletter included |
| One newsletter | list:news@example.com | Matches mail sent through that mailing list only |
| Newsletters, broadly | unsubscribe | Also catches receipts and account emails that carry an unsubscribe footer |
| Files from one person | from:amy@example.com has:attachment | Files shared as Google Drive links match has:drive, not has:attachment |
| Calendar invites | filename:ics | Only invites that arrive with an .ics file attached |
| Several senders | from:(amy@example.com OR david@example.com) | One filter instead of two, which keeps you clear of the 1,000 limit |
Two operators turn a rough filter into a precise one. Quotes match an exact phrase, so "payment received" ignores emails that merely contain both words. A minus sign excludes, so unsubscribe -from:mybank.com keeps your bank's statements out of the newsletter label.
Leave date and status operators out of filters. older_than:, newer_than:, is:unread and label: describe what has happened to a message since it arrived, and a filter checks each message at the moment it arrives, when it is seconds old and unread. Use them for one-off cleanups instead. The Gmail filter generator marks which operators are cleanup-only.
How to Label Emails Already in Your Inbox
There are two ways, and neither needs a filter you plan to keep.
- While creating a filter. Tick Also apply filter to matching conversations in step 6. The checkbox shows how many existing conversations match, which doubles as a last check that the query is right.
- By hand. Search for the emails, tick the select-all checkbox above the list, click Select all conversations that match this search, then click the label icon, choose the label and click Apply.
Only labels work retroactively. A filter that forwards mail affects new messages only, never the ones already in your account (Google Help, 2026).
Gmail Filter Limits to Know Before You Build Twenty
- One label per filter. The filter settings allow "only one user-defined label" (Google for Developers, 2026). If an email should be both Clients and Invoices, create two filters with the same search.
- 1,000 filters per account. "You can only create a maximum of 1,000 filters" (Gmail API reference, 2026). Grouping senders with
ORkeeps the count down. - Every criterion must match. When a filter has several conditions, a message has to satisfy all of them (Google for Developers, 2026). Use
ORinside one field when you mean "any of these". - A filter acts once. It labels a message when it arrives and never looks at the thread again. It can't move a thread from Waiting to Done when the reply finally comes in.
Why a Gmail Filter Labels the Wrong Emails
- The word is in a footer, a signature or a quoted reply. Has the words searches the whole message. Move the term into
subject:or put the phrase in quotes. - The sender uses more than one address. Billing mail often comes from a different address than the newsletter. Match the domain, or join the addresses with
OR. - Two filters match, so the email gets both labels. Look through Filters and Blocked Addresses for overlapping searches, and add a minus term to one of them.
- Skip the Inbox hid it. Mail you expected in the inbox went straight to the label. Open the label to find it, then edit the filter and untick Skip the Inbox.
- The email is older than the filter. Filters only act on new mail unless you ticked the box to apply them to matching conversations.
When an AI Label Does Better Than a Gmail Filter
Filters are the right tool whenever a rule can describe the email: a sender, a subject pattern, an attachment. They're free, they run inside Google, and nothing else reads your mail. Keep using them for that.
They stop working when the label depends on what the email means. Action Needed is the clearest case. A request to sign a contract and a newsletter about contract software use the same words, and no filter can tell them apart. Gmail's built-in AI doesn't fill the gap either: Gemini in Gmail can't create labels (Zapier, 2026).
| Gmail filters | AI labels (NeatMail) | |
|---|---|---|
| What decides the label | Words, addresses and attachments you specify | What the email says, read by an AI model against your label descriptions |
| Setup | One search per label, maintained by hand | A label name and one sentence describing it |
| Later in the thread | Applied once, on arrival | Status labels move, from Action Needed to Resolved |
| Who reads your mail | Google only | NeatMail connects over OAuth and sends each new email to an AI model to classify |
| Cost | Free | Paid, or free to self-host |
Here is how NeatMail does it, from its public source code on GitHub:
- Each label is a name plus a description of 10 to 200 characters. The default Finance label, for example, reads: "Money-related communication: invoices, receipts, billing, payments, expenses, payroll, taxes, statements."
- An AI model reads each new email and picks the label whose description fits. The label is then added in Gmail like any other, so it shows in the Gmail app and in search.
- The starting set is eight labels: Action Needed, Pending Response, Automated alerts, Finance, Event update, Read only, Resolved and Marketing. You can add your own, described in your own words.
- Status labels replace each other. Action Needed, Pending Response and Resolved are one-per-thread, so a thread shows where it stands now. Topic labels such as Finance are never removed.
- Promises get their own label. Commitments you make or receive go under a single Follow up label with a due date. How follow-ups work covers that side.
If you'd rather keep everything inside Google, the filters above cover most of what a label system needs, and the Gmail filter generator writes each query for you. If your labels depend on what people are asking for, see NeatMail's plans.
Frequently asked questions
Can Gmail automatically label emails?
Yes. A filter applies a label to every new email that matches a search, such as a sender or a word in the subject. Search for the emails, open the search options, click Create filter, tick Apply the label, choose the label and click Create filter again. Tick "Also apply filter to matching conversations" to label existing mail as well.
How do I apply a label to existing emails in Gmail?
Either tick "Also apply filter to matching conversations" while creating a filter, or do it by hand: search for the emails, tick the select-all checkbox, click "Select all conversations that match this search", then click the label icon, choose the label and click Apply.
Can a Gmail filter apply more than one label?
No. Gmail allows only one user-defined label per filter. To give the same emails two labels, create two filters with the same search, one for each label.
How many filters can Gmail have?
Up to 1,000 per account, according to Google's Gmail API reference. If you get close, merge filters by joining senders or keywords with OR inside one search.
Can Gmail label emails based on their content?
Only on the words they contain. "Has the words" matches text anywhere in the message, but it can't judge meaning, so a filter for "contract" catches a contract to sign and a newsletter about contracts alike. Labels that depend on meaning, such as Action Needed, need an AI tool that reads the email.
Why is my Gmail filter not labeling emails?
The usual causes are an email that arrived before the filter existed, a sender using a different address than the one in the filter, a search term that appears only in a quoted reply or footer, or Skip the Inbox sending the email straight to the label. Run the filter's search in the search bar to see exactly what it matches.