Home · Blog · User Agent Strings
HTTP · Privacy

How User Agent Strings Actually Work

The HTTP User-Agent header is one of the strangest artifacts of web history. Here's what it actually contains, how browsers and bots identify themselves, and what UA-based detection really costs in 2026.

9 min read·Updated June 2026

Anatomy of a modern UA string

Take a typical Chrome on macOS:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)
AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/124.0.0.0 Safari/537.36

That single line contains five claims, none of which are exactly true:

Why every browser claims to be Mozilla

In 1995, Netscape (Mozilla) shipped frames. Web servers started sending the frames version of pages only to UAs starting with Mozilla/. When Internet Explorer added frame support, Microsoft prefixed its UA with Mozilla/ to qualify — and added the real identifier later as a "compatible" token. Every browser since has done the same thing. The web's compatibility story is written in the UA string.

Quick demoPaste your current UA into the User Agent Parser to see exactly which browser, engine, OS and device it claims to be.

Detecting devices, bots and crawlers

Mobile vs desktop

The reliable signal is the literal substring Mobile in Chrome/Safari UAs, plus form-factor tokens like iPhone, iPad and Android. Don't rely on screen size — desktop browsers can be narrow, and tablets can be wide.

Bots and crawlers

Well-behaved bots identify themselves clearly:

Googlebot/2.1 (+http://www.google.com/bot.html)
Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)
Mozilla/5.0 (compatible; AhrefsBot/7.0; +http://ahrefs.com/robot/)

Look for bot, crawler, spider, or a +http URL pointing to the operator. Verify with reverse DNS — anyone can claim to be Googlebot.

Headless browsers and scrapers

Default Puppeteer leaks HeadlessChrome; default Playwright leaks nothing in the UA but exposes itself through navigator.webdriver. Sophisticated scrapers spoof real UAs, which is why UA-based bot detection alone is never enough.

Privacy implications

The UA string is a passive fingerprinting vector. Combined with screen resolution, timezone, language and installed fonts, it routinely identifies an individual browser. Browsers have responded by:

If you're building new server-side logic, prefer Client Hints. Treat the legacy UA as a coarse hint, not a fact.

What to actually do with the UA header

What not to do:

FAQ

Why does Chrome's User Agent contain the word Mozilla?
For backward compatibility. Early servers gated content on whether the UA started with Mozilla/. Every browser since has kept the prefix to avoid being downgraded.
Can I trust the User Agent header?
No. The UA is sent by the client and can be set to any string. Use it for analytics and progressive enhancement, never for security decisions or authorization.
What is User-Agent Client Hints?
A structured replacement for the UA header. Browsers expose information via Sec-CH-UA-* headers and decide what to share with each origin.
How do I verify Googlebot is really Googlebot?
Do a reverse DNS lookup on the request IP and check it resolves under googlebot.com or google.com, then forward-resolve that hostname back to the original IP.