Every time your browser makes a request, it sends a header called User-Agent -- a single line of text describing what's asking for the page. Servers use it to decide whether to serve a mobile layout, log analytics, or block a bot. It looks technical and authoritative. It's also, in a lot of ways, an unreliable relic.
What's actually packed into the string
A typical User-Agent looks like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
That Mozilla/5.0 at the start isn't a lie exactly, but it's not telling you what you think either -- it's a compatibility token nearly every browser still includes because, decades ago, servers checked for it before serving modern pages. Everyone kept sending it so nothing would break. The rest of the string layers on the rendering engine, the OS, and the actual browser and version, in an order that made sense at the time each new browser was trying to impersonate the one before it.
Why Chrome's string mentions Safari and "like Gecko"
This is the part that trips people up: Chrome's User-Agent contains Safari and like Gecko, and Safari's contains Mozilla. None of these browsers are lying about who made them -- they're carrying forward tokens from the browser wars, when sites checked User-Agent strings to decide what markup to send, and new browsers added the old browser's name to the string so they wouldn't get served broken pages. The practice never fully went away, so modern strings are historical artifacts as much as they are current descriptions.
It's self-reported, and easy to fake
Nothing stops a browser -- or a script -- from sending any User-Agent it wants. Browser dev tools let you override it with one click, and any HTTP client library lets you set it to an arbitrary string. That means a website can't treat the User-Agent as proof of anything; it's a hint, not an identity check. Bots that want to look like real traffic just copy a common browser's string, and legitimate tools sometimes spoof a different one to get around sites that block based on it.
Why it's slowly disappearing
Browser vendors are actively reducing how much the User-Agent reveals. Chrome has been freezing and simplifying its User-Agent string in favor of "User-Agent Client Hints," an opt-in API where a site has to explicitly ask for details like OS version instead of getting them by default. The reasoning is fingerprinting: a detailed, unique-enough User-Agent combined with other signals can help track a specific device across sites without cookies. Expect the plain User-Agent string to keep getting vaguer over time even as the underlying detail becomes available through other, more deliberate channels.
Reading one yourself
If you're debugging why a site is serving you a weird layout, or you just want to see what your own browser is announcing, paste the string into the User-Agent Parser to break it into browser, version, OS, and device type instead of parsing the raw text by eye.