You know the message is in there somewhere. It might be a train ticket, a receipt, or an answer from last month, but your inbox now holds thousands of messages, and scrolling back through them page by page eats up the evening. Gmail search operators offer a faster way to narrow the pile down, and they do not need a new app or a tidy inbox first.
In short: Gmail search operators are short codes you type in the Gmail search box, such as from:, subject: or has:attachment, to narrow results to one sender, topic or file type. Combine two or more operators to find receipts, large attachments or old threads without scrolling. Results show only mail that is actually in your mailbox.
In this guide
- Find mail from one sender: from:
- Find mail sent to one person: to:
- Find mail by its subject: subject:
- Find mail with a file attached: has:attachment
- Find large messages: larger:
- Find mail from before a date: before:
- Find mail from after a date: after:
- Find mail under one label: label:
- Search one part of Gmail: in:
- Show only unread mail: is:unread
- Show only starred mail: is:starred
- How to combine operators
- Common mistakes to avoid
- Quick check before you finish
- Final thoughts
All of the operators below are typed in the Gmail search box at the top of the page, on a computer or in the Gmail app. Type the operator, press Enter, and Gmail shows the matching messages. Clear the search box when you want to go back to your normal inbox view.
Find mail from one sender: from:
from: limits results to mail sent by one person or one address. Type it with no space after the colon, then the name or address, for example from:[email protected].
Use it when you remember who sent a message but not when it arrived. It is a good first step for finding a receipt from one shop, or a reply from one colleague, among a busy inbox.
Find mail sent to one person: to:
to: limits results to mail addressed to one person, for example to:[email protected]. As with from:, leave no space after the colon.
Use it when you want to check what you sent to someone, or to find a message that was sent to a shared address. It helps when a thread has several people in it and you only want the messages aimed at one of them.
Find mail by its subject: subject:
subject: looks only at the subject line, not the whole message. For example, subject:invoice finds messages with the word invoice in the subject.
Use it when a subject word stands out in your memory, even if you cannot remember the sender. It cuts out messages that only mention the word in passing further down the text.
Find mail with a file attached: has:attachment
has:attachment shows only messages that carry a file. Add a word after it to narrow the result, for example has:attachment contract.
Use it when you need a document, a photo or a form that someone sent you, but you do not want to open every message from that person. It is the quickest route to a file you know was attached.
Find large messages: larger:
larger: finds messages above a size you choose, written as a number followed by M for megabytes, for example larger:10M.
Use it when your mailbox feels full and you want to spot the biggest messages first. Large attachments are often the reason a few messages take up far more room than hundreds of short notes.
Find mail from before a date: before:
before: finds messages sent before the date you give, written as year, month and day, for example before:2025/01/01.
Use it when you are looking for an old thread and you know roughly how old it is. It keeps recent mail out of the way, so the older messages you actually want are easier to spot.
Find mail from after a date: after:
after: works the other way round, finding messages sent after the date you give, for example after:2026/01/01.
Use it when you only care about recent mail, such as this year’s bills or messages since a trip. Pair it with before: when you want mail from one clear period, as shown below.
Find mail under one label: label:
label: searches inside one label, for example label:receipts. The label has to exist in your Gmail account, and its name has to match.
Use it when you already sort some mail into labels and want to search inside just one pile. It is handy for receipts, school mail or work mail that you have already grouped together.
Search one part of Gmail: in:
in: picks which part of Gmail to search, for example in:archive to search messages you have archived, or in:anywhere to search across Gmail, including Spam and Trash.
Use it when a normal search brings back too much, or when the message you want is no longer in your inbox. A search in your archive, for instance, will not be crowded by new mail still sitting in your inbox.
Show only unread mail: is:unread
is:unread shows only messages you have not opened yet, for example is:unread on its own, or is:unread from:[email protected] for unread mail from one sender.
Use it at the end of the day to see what still needs your attention, without re-reading everything you have already dealt with.
Show only starred mail: is:starred
is:starred shows only messages you have marked with a star, for example is:starred on its own.
Use it for messages you saved on purpose: a booking reference, an address, or a note you will need again. If you star the few messages that matter as you go, this search becomes a short list of your own picks.
How to combine operators
One operator is often enough, but two or three together narrow a search far better. Put a space between operators, and Gmail will only show messages that match all of them. For example, from:[email protected] has:attachment finds only messages from Maya that carry a file.
To search a date range, put before: and after: together, for example after:2025/01/01 before:2025/04/01 for mail from the first three months of 2025. To leave something out, put a minus sign straight before an operator or word, for example from:[email protected] -newsletter. To match an exact phrase, put it in quotes, for example "train ticket".
Start with the detail you are surest about, such as the sender or the date, then add one more operator at a time. If a combined search comes back empty, take one operator away and try again, rather than starting from scratch.
Common mistakes to avoid
- Leaving a space after the colon, as in
from: [email protected], which stops the operator from working as intended. - Using a label name that does not exist, or spelling it differently from the label in your account, and then wondering why nothing appears.
- Expecting a search to find a message that was deleted, or that is in a different account. Gmail can only search the mail that is actually in the account you are signed in to.
- Adding too many operators at once, so the search becomes so narrow that the message you want is filtered out too.
- Typing a size for larger: in the wrong form. Use a number with M, as in
larger:10M, rather than a longer unit name.
Quick check before you finish
Try three searches on real mail. First, search from: with the address of someone who writes to you often. Next, search has:attachment with a word you know was in a document you received. Then try a date search with before: or after: for a month you remember well.
If those three searches show the messages you expected, you have the pattern: operator, no space after the colon, then the detail. If a search comes back empty, check the spelling, the colon and the date format before you assume the message is gone.
Final thoughts
You do not need to learn every Gmail search operator to make your inbox easier to use. Two or three that match how you actually look for mail, such as from:, has:attachment and a date operator, will cover most everyday searches. Keep this guide handy, try one operator on a message you already know, and add the rest only when you need them.
Related guide
For a simple way to sort the mail you keep, see also: How to Organise Gmail with Labels and Filters in 15 Minutes.
For another everyday Gmail skill, see also: 10 Gmail Keyboard Shortcuts That Save Time.
