Refine searches in Gmail

Want to get more out of Google apps at work or school?  Sign up for a Google Workspace trial at no charge.

You can use words or symbols called search operators to filter your Gmail search results. You can also combine operators to filter your results even more.

Use a search operator

  1. Go to Gmail.
  2. In the search box, type the search operator.

Tips:

  • Once you do a search using search operators, you can use the results to set up a filter for these messages.
  • When using numbers as part of your query, a space or a dash (-) will separate a number while a dot (.) will be a decimal. For example, 01.2047-100 is considered 2 numbers: 01.2047 and 100.
What you can search by Search operator
Specify the sender

from:

Example: from:amy

Specify a recipient

to:

Example: to:david

Words in the subject line

subject:

Example: subject:dinner

Messages that match multiple terms

OR or { }

Example: from:amy OR from:david

Example: {from:amy from:david}

AND

Example: from:amy AND to:david

Remove messages from your results

-

Example: dinner -movie

Find messages with words near each other. Use the number to say how many words apart the words can be

Add quotes to find messages in which the word you put first stays first.

AROUND

Example: holiday AROUND 10 vacation

Example: "secret AROUND 25 birthday"

Messages that have a certain label

label:

Example: label:friends

Messages that have an attachment (including inline images)

has:attachment

Messages that have a Google Drive, Docs, Sheets, or Slides attachment or link

has:drive

has:document

has:spreadsheet

has:presentation

Messages that have a YouTube video

has:youtube

Messages from a mailing list

list:

Example: list:info@example.com

Attachments with a certain name or file type

filename:

Example: filename:pdf

Example: filename:homework.txt

Search for an exact word or phrase

" "

Example: "dinner and movie tonight"

Group multiple search terms together

( )

Example: subject:(dinner movie)

Messages in any folder, including Spam and Trash

in:anywhere

Example: in:anywhere movie

Search for messages that are marked as important

is:important

label:important

Starred, snoozed, unread, or read messages

is:starred

is:snoozed

is:unread

is:read

Example: is:read is:starred

Messages that include an icon of a certain color

has:yellow-star
has:orange-star
has:red-star
has:purple-star
has:blue-star
has:green-star
has:red-bang
has:orange-guillemet
has:yellow-bang
has:green-check
has:blue-info
has:purple-question

Learn how to star emails in Gmail.

Recipients in the cc or bcc field

cc:

bcc:

Example: cc:david

Search for messages sent during a certain time period

after:

before:

older:

newer:

Example: after:2004/04/16

Example: after:04/16/2004

Example: before:2004/04/18

Example: before:04/18/2004

Search for messages older or newer than a time period using d (day), m (month), and y (year)

older_than:

newer_than:

Example: newer_than:2d

Search by email for delivered messages

deliveredto:

Example: deliveredto:username@gmail.com

Messages in a certain category

category:primary
category:social
category:promotions
category:updates
category:forums
category:reservations
category:purchases

Messages larger than a certain size in bytes

size:

Example: size:1000000

Messages larger or smaller than a certain size in bytes

larger:

smaller:

Example: larger:10M

Results that match a word exactly

+

Example: +unicorn

Messages with a certain message-id header

rfc822msgid:

Example: rfc822msgid:200503292@example.com

Messages that have or don't have a label

has:userlabels

has:nouserlabels

Important: Labels are only added to a message, and not an entire conversation.

Search for messages you muted

is:muted

Search
Clear search
Close search
Google apps
Main menu
8363240192822174882
true
Search Help Center
true
true
true
true
true
17
false
false