slice icon Context Slice

Gmail Search Operators

Complete reference for Gmail query syntax—all operators with examples

Gmail Search Operators

Gmail search uses operators that combine with AND by default. Use OR for alternatives, parentheses for grouping, and minus for exclusion.

Sender and Recipient

from:alice@example.com matches sender email or name. to:bob@company.com matches recipients. cc:team@company.com and bcc:secret@company.com match copy recipients. Use deliveredto:me@example.com for the actual delivery address (useful with aliases).

Subject and Content

subject:quarterly report searches subject lines. Plain text searches both subject and body. "exact phrase" requires exact match including word order.

Date Ranges

after:2024/01/15 and before:2024/02/01 use YYYY/MM/DD format. newer_than:7d and older_than:2m use relative time—d (days), m (months), y (years). Combine for ranges: after:2024/01/01 before:2024/02/01.

Message Properties

is:unread or is:read for read status. is:starred for starred messages. is:important for priority inbox. is:snoozed for snoozed items. has:attachment for messages with any attachment. has:drive or has:document for Google Drive links.

Labels and Location

in:inbox, in:sent, in:drafts, in:trash, in:spam, in:anywhere (includes trash/spam). label:work matches custom labels. category:primary, category:social, category:promotions, category:updates, category:forums for inbox categories.

Attachments

filename:pdf matches attachment type. filename:report.xlsx matches specific filenames. has:attachment for any attachment. Combine: has:attachment filename:pdf for PDF attachments.

Size

larger:10M and smaller:5M filter by size. Use K, M, or raw bytes. size:5000000 is exactly 5MB.

Advanced

AROUND 5 finds words within N words of each other: meeting AROUND 5 budget finds "meeting" within 5 words of "budget". OR combines alternatives: from:alice OR from:bob. Minus excludes: project -status finds "project" without "status". Parentheses group: (from:alice OR from:bob) after:2024/01/01.

Common Patterns

Find unread from specific sender: is:unread from:boss@company.com

Recent attachments: has:attachment newer_than:7d

Everything from a domain: from:@company.com

Large old emails to clean up: larger:10M older_than:1y

Newsletters to unsubscribe: unsubscribe category:promotions older_than:30d

Sent but no reply: in:sent to:client@company.com newer_than:7d

Thread search: subject:"Q4 planning" from:team@company.com

                  # Gmail Search Operators

Gmail search uses operators that combine with AND by default. Use OR for alternatives, parentheses for grouping, and minus for exclusion.

## Sender and Recipient

`from:alice@example.com` matches sender email or name. `to:bob@company.com` matches recipients. `cc:team@company.com` and `bcc:secret@company.com` match copy recipients. Use `deliveredto:me@example.com` for the actual delivery address (useful with aliases).

## Subject and Content

`subject:quarterly report` searches subject lines. Plain text searches both subject and body. `"exact phrase"` requires exact match including word order.

## Date Ranges

`after:2024/01/15` and `before:2024/02/01` use YYYY/MM/DD format. `newer_than:7d` and `older_than:2m` use relative time—d (days), m (months), y (years). Combine for ranges: `after:2024/01/01 before:2024/02/01`.

## Message Properties

`is:unread` or `is:read` for read status. `is:starred` for starred messages. `is:important` for priority inbox. `is:snoozed` for snoozed items. `has:attachment` for messages with any attachment. `has:drive` or `has:document` for Google Drive links.

## Labels and Location

`in:inbox`, `in:sent`, `in:drafts`, `in:trash`, `in:spam`, `in:anywhere` (includes trash/spam). `label:work` matches custom labels. `category:primary`, `category:social`, `category:promotions`, `category:updates`, `category:forums` for inbox categories.

## Attachments

`filename:pdf` matches attachment type. `filename:report.xlsx` matches specific filenames. `has:attachment` for any attachment. Combine: `has:attachment filename:pdf` for PDF attachments.

## Size

`larger:10M` and `smaller:5M` filter by size. Use K, M, or raw bytes. `size:5000000` is exactly 5MB.

## Advanced

`AROUND 5` finds words within N words of each other: `meeting AROUND 5 budget` finds "meeting" within 5 words of "budget". `OR` combines alternatives: `from:alice OR from:bob`. Minus excludes: `project -status` finds "project" without "status". Parentheses group: `(from:alice OR from:bob) after:2024/01/01`.

## Common Patterns

Find unread from specific sender: `is:unread from:boss@company.com`

Recent attachments: `has:attachment newer_than:7d`

Everything from a domain: `from:@company.com`

Large old emails to clean up: `larger:10M older_than:1y`

Newsletters to unsubscribe: `unsubscribe category:promotions older_than:30d`

Sent but no reply: `in:sent to:client@company.com newer_than:7d`

Thread search: `subject:"Q4 planning" from:team@company.com`