What is a user agent?
A user agent is how your browser introduces itself to every website you visit. Here is what it contains, why it looks so strange, and what is replacing it.
The one-sentence version
A user agent is a line of text sent in the User-Agent HTTP header with every request, naming the software making the request and the platform it is running on.
Yours, right now, is on the home page. It probably looks something like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Read literally, that string claims to be Mozilla, AppleWebKit, KHTML, Gecko, Chrome and Safari simultaneously. Only one of those is true. Understanding why requires a short trip through browser history.
Why every browser lies about what it is
In 1993, NCSA Mosaic sent NCSA_Mosaic/2.0. Simple and honest.
In 1994, Netscape Navigator arrived, code-named Mozilla, and sent Mozilla/1.0. Netscape supported frames; Mosaic did not. So servers started checking for Mozilla and sending frames-enabled pages only to browsers that claimed it.
In 1995, Internet Explorer shipped — and it supported frames too. But servers were checking for Mozilla, so IE would have been served the degraded page. Microsoft's solution was to claim to be Mozilla: Mozilla/1.22 (compatible; MSIE 2.0; Windows 95).
Every browser since has done the same thing, for the same reason, and the tokens accumulated. When Safari arrived it claimed compatibility with Netscape's Gecko engine so it would not be locked out of Gecko-only code paths. When Chrome arrived it claimed Safari. Nobody can remove any of it now, because somewhere a site still checks for the token and would break.
The anatomy of a modern string
Despite the historical noise, the structure is consistent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
─────┬───── ────────────┬──────────────── ───────┬──────── ────────┬────────── ──────┬────── ──────┬──────
│ │ │ │ │ │
vestigial platform: OS, arch engine and engine compat the actual more compat
prefix its version claim browser padding
The general grammar is a sequence of Product/Version tokens, each optionally followed by a parenthesised comment containing semicolon-separated details. Our format guide covers the grammar in depth, and the parser will break any string into these pieces for you.
What websites actually do with it
- Serving the right layout. Deciding between a mobile and desktop template — though CSS media queries have largely replaced this and do it better.
- Analytics. Nearly all browser and OS market-share data comes from parsing user agents at scale.
- Feature gating. Working around bugs in specific browser versions. Feature detection is the better practice, but version targeting is sometimes the only option for a known-broken build.
- Bot management. Identifying crawlers, deciding what to serve them, and rate-limiting abuse.
- Download links. Offering the macOS build to Mac visitors and the Windows build to everyone else.
Why it is being phased out
The user agent became a fingerprinting liability. A detailed string — exact OS build, exact device model, exact browser patch version — narrows a visitor down considerably, and combined with screen size, time zone and installed fonts it can identify a specific person across sites without any cookie at all.
Browsers responded by freezing the detail:
- Chrome reports
Android 10; Kon every Android device, whatever the real version and model. - Chrome reports a minor version of
0.0.0on every platform. - Safari froze the macOS version at
10_15_7. - Safari and Firefox report only a small set of possible strings on iOS.
The replacement is User-Agent Client Hints, which flips the model: instead of broadcasting everything to everyone, the browser sends a minimal set by default and reveals detail only to sites that explicitly ask for it. Sites that need the device model can request it; sites that do not, never receive it.
Should you still use it?
For analytics and rough segmentation, yes — it remains the only signal available for every client including bots and HTTP libraries. For deciding what code to run, no: use feature detection. For anything security-sensitive, absolutely not — the header is user-controlled and a single command-line flag away from saying anything at all.
Frequently asked questions
Where do I find my user agent?
The home page shows it immediately, fully parsed. In any browser you can also open developer tools and run navigator.userAgent in the console.
Is a user agent personal data?
On its own it is generally not considered personal data, since millions of people share identical strings. Combined with an IP address and other browser signals it can contribute to identifying an individual, which is why regulators treat fingerprinting — not the user agent alone — as the thing requiring consent.
Can a website see my real device if I change my user agent?
Often yes. Screen dimensions, touch support, GPU renderer, available fonts and the results of feature tests all continue to reflect your real device. Changing the string is useful for testing; it is not a privacy measure.
What is the difference between a user agent and a browser?
The browser is the software; the user agent is the string it sends to identify itself. In the HTTP specification “user agent” means any client making a request, which is why cURL, Python scripts and crawlers all send one too.