What Your User Agent Reveals (And Why It Matters)
Every website you visit knows your browser, operating system, and device — before you click a single link. The user agent string is a quiet piece of metadata that powers analytics, compatibility, and sometimes fingerprinting. Here's what it actually contains.
Anatomy of a User Agent String
Here's a typical user agent from Chrome on Windows:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Looks chaotic, but each token has meaning:
- Mozilla/5.0 — legacy prefix (explained below)
- (Windows NT 10.0; Win64; x64) — operating system, architecture
- AppleWebKit/537.36 — rendering engine family
- (KHTML, like Gecko) — more legacy compatibility
- Chrome/126.0.0.0 — actual browser name and version
- Safari/537.36 — yet more legacy compatibility
Why Does Every UA Start With "Mozilla"?
This is the most common question. The short version: a 1990s-era accident that never went away.
In 1994, Netscape Navigator (internal codename "Mozilla") was the dominant browser. Many websites started checking for "Mozilla" in the UA string to serve modern content (frames, images, etc.) vs. a basic fallback. When Microsoft launched Internet Explorer in 1995, IE included "Mozilla" in its UA to trick websites into serving the modern content. Every browser since has followed the same pattern. Removing "Mozilla" now would break compatibility with ancient code still in production.
It's a 30-year legacy of copied strings compounding on each other. Chrome includes "Safari" because Safari's engine was derived from WebKit. Edge includes "Chrome" because it's built on Blink. The string grows by accretion, never by removal.
What Websites Actually Do With It
Responsive design hints
Before CSS media queries, sites used UA sniffing to serve mobile vs. desktop layouts. Today, media queries are better — but UA detection is still used for device-specific optimizations (like serving smaller images to phones).
Analytics
Google Analytics, Matomo, and every other analytics tool uses UA to report browser share, OS share, and device types. This data drives decisions: "Should we still support IE11?" or "What percentage of visitors use iPhone?"
Bot detection
Search engine crawlers, automation tools, and scrapers often identify themselves via UA. Googlebot's UA is well-known: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html). Sites can serve different content to bots than to humans — which is fine for adapting rendering but risky if taken too far (cloaking).
Compatibility shims
Serving polyfills or fallback code to older browsers. If the UA identifies as IE11, serve the old code. Otherwise, serve modern code.
Privacy and Fingerprinting
UA alone isn't a unique identifier — millions of users share the same "Chrome on Windows 10" UA. But combined with other signals (screen resolution, installed fonts, timezone, language), UA contributes to browser fingerprinting — a technique that can uniquely identify users without cookies.
Modern browsers are reducing UA specificity through "UA reduction" (Chrome) and "frozen user agent" (Safari). The version number may be stripped to just major version. The exact OS version may be hidden. This is a privacy improvement but it requires code to use newer APIs (like User-Agent Client Hints) for legitimate detection.
Spoofing Your User Agent
All major browsers let you change your UA through developer tools. It's useful for:
- Testing responsive designs without different devices
- Viewing sites that lock out specific browsers
- Debugging UA-dependent bugs
- Some privacy gain (though fingerprinting still works)
Warning: some sites use UA detection for security. Spoofing can trigger anti-fraud systems. Don't spoof to your bank.
Common UA Patterns
Mobile Chrome on Android
Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36
Key markers: "Linux; Android", device name, and "Mobile".
Safari on iPhone
Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1
Key markers: "iPhone", iOS version (with underscores because of URL encoding).
Googlebot
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Minimal string with self-identification and contact URL.
Try the tool
Parse any UA string. See your browser, OS, device, and engine.
Frequently Asked Questions
Why does my user agent contain 'Mozilla' when I use Chrome?
Can I hide or change my user agent?
Is user agent detection reliable?
Can user agent identify me personally?
What's a 'bot' user agent?
Published April 2026 by Derek Giordano