# User agent

> The User-Agent header names the software making a request. See real browser and Googlebot strings, how to find bots in your logs, and why it can be faked.

Canonical: https://scaplet.com/glossary/user-agent

Glossary Glossary · Crawling

The User-Agent header names the software making a request. See real browser and Googlebot strings, how to find bots in your logs, and why it can be faked.

3 min

read

5

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

A user agent is the software making an HTTP request, and the User-Agent request header is the string that identifies it: application, operating system, vendor or version. Browsers and crawlers both send one. Because any client can send any value, a user-agent string alone never proves who a bot really is.

30-second check

## Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?

Summarize this page with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fuser-agent%20(%22User%20agent%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fuser-agent%20(%22User%20agent%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fuser-agent%20(%22User%20agent%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fglossary%2Fuser-agent%20(%22User%20agent%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 4 parts, 3 minutes.

1. [What a user-agent string looks like 01](#what-a-user-agent-string-looks-like)
2. [Why it matters for SEO 02](#why-it-matters-for-seo)
3. [Find crawlers in your logs 03](#find-crawlers-in-your-logs)
4. [Target a crawler in robots.txt 04](#target-a-crawler-in-robots-txt)

_01_Check it

## What a user-agent string looks like

MDN defines the User-Agent request header as a characteristic string that lets servers and network peers identify the application, operating system, vendor, and/or version of the requesting user agent. Browsers send a string that begins with `Mozilla/5.0`, and MDN's examples show crawler strings such as [Googlebot](/ai-crawlers/googlebot)'s carry the same prefix.

Browsers now expose less detail in this string for privacy. MDN points developers who need specifics to User-Agent Client Hints, requested through the `Accept-CH` response header.

Real examples (from MDN)

```
# Chrome on desktop User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 # Googlebot User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
```

_02_Explained

## Why it matters for SEO

Three jobs depend on the user agent. Your [robots.txt](/glossary/robots-txt) file targets crawlers by name with the `User-agent` line. Your server logs record who fetched what, which is how you see Googlebot, [Bingbot](/ai-crawlers/bingbot) and AI crawlers hit your pages. And rules at the server or CDN can allow or block a bot by its string.

Do not serve different content to browsers and crawlers based on this header. MDN calls serving different content to different browsers by parsing the User-Agent usually a bad idea, and Google's spam policies define [cloaking](/glossary/cloaking) as presenting different content to users and search engines with the intent to manipulate rankings, including text inserted only when the requesting user agent is a search engine. Use responsive CSS and feature detection for layout instead.

_03_How it works

## Find crawlers in your logs

In the default nginx and Apache combined log format, the user agent is the last quoted field. This command counts requests per user agent that mention "bot" or "crawler":

1. 1

### Reverse DNS

Run `host <ip>` on the address from your log. Google says to verify that the domain name is `googlebot.com`, `google.com`, or `googleusercontent.com`.
2. 2

### Forward DNS

Run `host <hostname>` and confirm it resolves back to the same IP.
3. 3

### Or match published ranges

Google publishes JSON files of crawler IP ranges in CIDR notation. Compare the request IP against them in code.

Count bot requests by user agent

```
awk -F'"' '{print $6}' /var/log/nginx/access.log | grep -Ei 'bot|crawler' | sort | uniq -c | sort -rn | head -20
```

A string that says Googlebot is a claim, not proof. Google's documentation notes that spammers or other troublemakers might falsely claim to be Google, so verify the IP.

_04_Check it

## Target a crawler in robots.txt

Each robots.txt group starts with a `User-agent` line naming the crawler it applies to. `User-agent: *` matches all crawlers except AdsBot, which must be named explicitly.

Robots.txt is voluntary. It only works for crawlers that respect it and is not a security mechanism. Google's robots.txt guide says that to keep information secure from crawlers, use other blocking methods, such as password-protecting private files on your server.

Block one crawler, allow everyone else

```
User-agent: GPTBot Disallow: / User-agent: * Allow: /
```

Questions

## Asked a lot.

4 questions people ask next, answered from the sources on this page.

_01_ Can a crawler fake its user agent?

Yes. The client chooses the value, so any bot can claim to be Googlebot or a browser. Verify claimed Google crawlers with reverse and forward DNS lookups or by matching Google's published IP ranges.

_02_ How do I see my own browser's user agent?

Open DevTools, go to the Network tab, click any request and read the User-Agent request header. In the console, `navigator.userAgent` prints the same string.

_03_ Should I serve different pages based on user agent?

Generally no. MDN says serving different content to different browsers is usually a bad idea. Use [responsive design](/glossary/responsive-design) and feature detection, and give crawlers the same content as users.

_04_ What is the Googlebot user agent?

One string MDN lists is `Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)`. Google's page on verifying Google requests explains how to confirm a request really comes from Google.

Sources · 5

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- mozilla.org
- google.com

1. 01 [User-Agent header - MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/User-Agent) developer.mozilla.org · checked 2026-10-24
2. 02 [Browser detection using the user agent - MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Browser_detection_using_the_user_agent) developer.mozilla.org · checked 2026-10-24
3. 03 [Verifying Google crawler requests - Google Search Central](https://developers.google.com/crawling/docs/crawlers-fetchers/verify-google-requests) developers.google.com · checked 2026-10-24
4. 04 [How to write and submit a robots.txt file - Google Search Central](https://developers.google.com/crawling/docs/robots-txt/create-robots-txt) developers.google.com · checked 2026-10-24
5. 05 [Spam policies for Google web search](https://developers.google.com/search/docs/essentials/spam-policies) developers.google.com · checked 2026-10-24

## Keep learning

[All glossary](/glossary)

[Learn Log file analysis Crawling and indexing](/glossary/log-file-analysis) [Related Googlebot Google](/ai-crawlers/googlebot) [Read next Web crawler Crawling and indexing](/glossary/web-crawler) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in glossary
[URL slug](/glossary/url-slug) [User-generated content](/glossary/user-generated-content) [UTM parameters](/glossary/utm-parameters)

More in Crawling and indexing
[Server-side rendering](/glossary/server-side-rendering) [Sitemaps report](/glossary/sitemaps-report) [SPA SEO](/glossary/spa-seo) [SSL certificate](/glossary/ssl-certificate) [SSR vs CSR](/glossary/ssr-vs-csr) [Subdomain vs subdirectory](/glossary/subdomain-vs-subdirectory) [Trailing slash in URLs](/glossary/trailing-slash) [unavailable_after](/glossary/unavailable-after) [URL fragment](/glossary/url-fragment) [URL Inspection tool](/glossary/url-inspection-tool) [URL parameters](/glossary/url-parameters) [URL structure](/glossary/url-structure) [User agent](/glossary/user-agent) [Video sitemap](/glossary/video-sitemap) [Web crawler](/glossary/web-crawler) [Web scraping](/glossary/web-scraping) [www vs non-www](/glossary/www-vs-non-www) [X-Frame-Options](/glossary/x-frame-options) [X-Robots-Tag](/glossary/x-robots-tag) [XML sitemap](/glossary/xml-sitemap) [301 redirect](/glossary/301-redirect) [302 redirect](/glossary/302-redirect) [410 Gone](/glossary/410-gone) [A record (DNS address record)](/glossary/a-record)

Terms on this page
[robots.txt](/glossary/robots-txt) [Cloaking](/glossary/cloaking) [Responsive design](/glossary/responsive-design)

Free · 2 minutes

## Know the term. _Now check your site._

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **+212%** organic clicks in 90 days Ledgerly
