"User agent" has two senses, and people switch between them freely. One is the software itself, whatever fetches a page on someone's behalf, from a browser to a search engine crawler to a command-line tool. The other is the user-agent string: the line of text that software sends with each HTTP request, in the User-Agent header, to say what it is.
Servers read that string to work around browser bugs, to adjust a response and to count which browsers visit. For SEO, it is how you tell a visit from Chrome apart from a visit by Googlebot in your logs, and how you address crawlers in robots.txt.
What a user-agent string looks like
The HTTP standard defines the header as one or more product names with optional versions, each followed by optional comments in brackets. It says a client should send one with every request unless it's set up not to.
| Who is asking | Example string |
|---|---|
| Chrome on a Mac | Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 |
| Googlebot Smartphone | Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) |
| curl | curl/7.64.1 |
Browser strings are cluttered for historical reasons. Almost every browser starts with Mozilla/5.0, and Chrome also claims to be "like Gecko" and "Safari", so that old sites that checked for those names would still serve it properly. In Google's crawler strings, W.X.Y.Z stands for the Chrome version Googlebot is currently using.
Browsers now say less about you
The full string helped sites recognize individual visitors across the web (fingerprinting), so browsers have cut it down. Chrome on Android now reports a fixed "Android 10", a fixed device model "K" and zeros for every version number after the major one. A site that needs more detail has to ask for it with User-Agent Client Hints: the server sends an Accept-CH header, and the browser answers with Sec-CH-UA-* headers MDN.
So if your code reads the phone model or operating system version from the string, it is now reading placeholder values.
Why user agents matter for SEO
Crawlers announce themselves in the string, which makes it the first thing to check in log file analysis. Three things follow from that.
robots.txt rules address user agents by token. A robots.txt group starts with a user-agent: line naming a crawler's short token, not its full string. Google lists a token for each crawler: Googlebot for Search, Googlebot-Image for images, and so on.
Anyone can fake the string. Scrapers often call themselves Googlebot to get past blocks. Google warns that the string can be spoofed and gives two ways to check a visitor: a reverse DNS lookup (asking which host name the visitor's IP address belongs to), which should end in googlebot.com (or google.com for some fetchers), or a match against its published IP ranges Google Search Central. Do this before you block or allow traffic by name.
Serving by user agent is allowed; deceiving with it is not. Dynamic serving, where a server sends different HTML to phones and desktops based on the string, is a supported setup as long as the response carries Vary: User-Agent. Showing search engines different content from what people see, to manipulate rankings, is cloaking and breaks Google's spam policies. MDN's advice for most sites is simpler still: don't serve different content by browser at all; use responsive design.
How to see a page as another user agent
To check what your server sends to a phone or an old browser, override your user agent in Chrome DevTools under Network conditions. Chrome then identifies itself differently, but still renders the page as Chrome; only what the server sends changes.
Pretending to be Googlebot in your browser is a weak test. Your request doesn't come from Google's addresses, so a server that verifies crawlers treats you as a stranger. To see what Google gets, run a live test in Search Console's URL Inspection tool, which fetches the page as Google-InspectionTool and shows a screenshot of the result.
Mistakes to avoid
- Treating the string as proof. It's a claim, not an identity. Verify crawlers by DNS or IP before letting them past rate limits or paywalls.
- Blocking by a loose match. A firewall rule that drops every string containing "bot" can lock out the crawlers you want. Block verified bad actors instead.
- Reading device details from reduced strings. Use client hints or feature detection when you need to know what a device can do.
- Hiding content from one user agent. If Googlebot sees less than visitors, it can't index what it can't see; if it sees more, that is cloaking.