Reading a user-agent string
A typical string such as Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36 carries decades of compatibility tokens. Mozilla/5.0 means nothing today; AppleWebKit and Safari appear even in Chrome because old sites checked for them.
Since 2022 browsers freeze parts of the string: the operating system version, the device model on Android and the minor version numbers. Client Hints (Sec-CH-UA headers and navigator.userAgentData) carry the accurate values instead.
Uses
Read server logs, check what a bot claims to be, or debug why a site treats a browser differently. A user-agent can be set to anything, so never rely on it for security.
Questions
- Can I change my user-agent?
- Yes, through developer tools or an extension. Sites may then send pages meant for another browser.