Reading a user-agent string piece by piece
Here is the string a current Chrome on Windows sends:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36
(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
- Mozilla/5.0: a leftover from the 1990s that every browser still sends. It carries no information.
- (Windows NT 10.0; Win64; x64): the platform, here 64-bit Windows.
- AppleWebKit/537.36 (KHTML, like Gecko): engine history. Chrome’s Blink engine split from WebKit, which grew out of KHTML.
- Chrome/131.0.0.0: the real browser and its major version.
- Safari/537.36: added so sites that only checked for Safari would still work.
Because each browser copies tokens from the others, the order of the checks matters. Edge, Opera and Samsung Internet all contain “Chrome”, and Chrome contains “Safari”, so the parser looks for the most specific name first and reads the version from that browser’s own token.
Details browsers no longer give away
To make fingerprinting harder, browsers now freeze parts of the string. Chrome finished this in 2023, and Safari and Firefox do something similar:
- Windows 11 still reports “Windows NT 10.0”, so the parser shows “Windows 10 or 11”.
- Every Mac reports macOS 10.15 (written 10_15_7 or 10.15), whatever version is installed, so only “macOS” is shown.
- Chrome on Android sends “Android 10; K” in place of the real version and phone model.
- The minor version is always 0.0.0 in Chrome, so only the major version means anything.
Chromium browsers can share the hidden details through User-Agent Client Hints. A server that sends Accept-CH: Sec-CH-UA-Platform-Version gets the real Windows build back, and a platform version of 13 or higher means Windows 11.
iPhones, iPads and Chrome on iOS
Every browser on an iPhone or iPad is built on Apple’s WebKit engine, apart from alternative engines allowed in the EU since 2024. Chrome on iOS therefore shows as Chrome with the WebKit engine, and its version sits in a CriOS token in place of the usual Chrome one.
Since iPadOS 13, Safari on most iPads asks for desktop websites and sends the same string as a Mac. Such an iPad is reported as macOS on a desktop, and no parser can tell the two apart from the string alone. Pages that must know check for touch support in the browser instead.
Bots, fakes and what to use instead
Strings that mention a bot, crawler or spider, such as Googlebot or bingbot, are marked as Bot. Anyone can copy those words, though, so a request that claims to be Googlebot proves nothing. Google’s advice is a reverse DNS lookup of the IP address, which must end in googlebot.com or google.com, followed by a forward lookup that returns the same IP.
For deciding what a page should do, test for the feature itself in JavaScript, such as whether the browser supports a certain API, and keep user-agent checks for analytics, logs and bug reports. When someone reports a problem on your site, ask them to paste their string here: it tells you the browser, version and system in one line.