Skip to main content
Home/Blog/Why User-Agent Strings Are So Complicated: Browser Wars and Legacy Tokens
Developer Tools

Why User-Agent Strings Are So Complicated: Browser Wars and Legacy Tokens

EXCERPT_PLACEHOLDER

By Inventive HQ Team•
Why User-Agent Strings Are So Complicated: Browser Wars and Legacy Tokens

The User-Agent string is complicated because many modern browsers retain compatibility tokens from earlier browsers — Chrome's string includes "Mozilla," "AppleWebKit," "KHTML, like Gecko," and "Safari" alongside its own name. This is the residue of decades of browser compatibility work: web servers used to sniff the User-Agent to decide which features to serve, so newer browsers often retained familiar tokens to avoid being served different content. The result is a string where a Chrome-labeled token (Chrome/120.0.0.0 in the example below) appears among compatibility tokens. That token alone does not establish the browser: Microsoft's Edge example includes the same Chrome/120.0.0.0 token followed by Edg/120.0.0.0. Like the rest of the header, these tokens are client-supplied and can be spoofed. MDN's User-Agent reference shows current browser and non-browser formats.

That is the summary an AI Overview would give you. Here is what it can't show you — the exact anatomy of a real string, the impersonation chain that produced each token, a lookup table of which claims are true, and a live parser you can paste your own User-Agent into.

Anatomy of a real User-Agent string

Here is an example Chrome 120-on-Windows User-Agent, dissected token by token. The highlighted segments include browser, platform, and compatibility tokens; the string alone cannot verify any of them. Other Chromium browsers may include the same Chrome-labeled token alongside their own tokens:

Anatomy of a Chrome User-Agent string A breakdown of Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36, labeling compatibility, platform, engine, and browser tokens. The x64 and Chrome tokens do not prove the CPU architecture or browser identity. One string, six claims Chrome and Edge can share these tokens; the header can be spoofed Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Mozilla/5.0 Fossil from Netscape. Common in current browsers. Windows NT 10.0 Fixed Windows OS/CPU segment in reduced Chrome UA. AppleWebKit/537.36 Compatibility token; Chrome uses Blink. Chrome/120.0.0.0 Also appears in Edge UA. Minor version zeroed. (KHTML, like Gecko) — "I render like Firefox's Gecko engine" (it does not) Safari/537.36 — compatibility token retained by Chrome

The impersonation chain: how it got this bad

These tokens accumulated as browsers adapted to sites that checked User-Agent strings. The timeline below illustrates several steps in that history.

The User-Agent compatibility chain, 1993 to 2008 Timeline showing Mosaic, Netscape/Mozilla, Internet Explorer, Safari, and Chrome each adopting the identifying tokens of prior browsers. Compatibility tokens accumulated across browsers 1993 · NCSA Mosaic NCSA_Mosaic — an early browser product token 1994 · Netscape Navigator ("Mozilla") Mozilla/1.0 — Netscape's browser token 1995 · Internet Explorer 2.0 for Windows 95 Mozilla/… (compatible; MSIE 2.0; …) — IE uses a Mozilla token 2003 · Safari (built on KHTML/WebKit) …AppleWebKit/48 (like Gecko) Safari/48 — January 2003 Safari UA 2008 · Chrome retains Safari-style tokens Mozilla + AppleWebKit + KHTML/Gecko + Chrome + Safari tokens

Browser sniffing encouraged later browsers to retain familiar tokens for compatibility. Removing a token can still affect sites that check for it. NCSA documents Mosaic's early history, and Mozilla recounts Netscape's 1994 launch. The Computer History Museum dates IE 2.0's Windows 95 release to November 1995; Microsoft's March 1996 announcement concerns additional language releases. Mozilla's historical account explains IE's Mozilla compatibility token. Apple announced Safari in 2003, WebKit documents its AppleWebKit and like Gecko tokens, and Google dates Chrome's launch to 2008.

Token-by-token: which claims are actually true?

This fixed table explains the Chrome-on-Windows example above. The parser below analyzes a string you enter separately; it does not update this table.

TokenWhat it claimsIs it true?Why it's there
Mozilla/5.0"Mozilla-compatible"Compatibility tokenCommon in current browsers; some other clients use different prefixes
Windows NT 10.0"Running on Windows 10"PartlyWindows 11 also reports 10.0 — indistinguishable here
Win64; x64"64-bit Windows on x64"Not reliable for CPU architectureChrome fixes the Windows OS/CPU segment to Windows NT 10.0; Win64; x64, so x64 does not establish the actual CPU architecture, including on Windows on Arm; see Chrome's reduction guidance
AppleWebKit/537.36"WebKit engine build 537.36"NoCompatibility token in this Chrome example; Blink is its rendering engine
(KHTML, like Gecko)"I render like KHTML and Gecko"NoCompatibility wording for sites that checked KHTML or Gecko tokens
Chrome/120.0.0.0"Chrome 120"Does not identify Chrome by itselfChromium-based browsers can include this token; Microsoft's Edge 120 example also includes Edg/120.0.0.0. The minor/build components are zeroed in reduced UAs, and the header can be spoofed
Safari/537.36"I am also Safari"NoInherited so Safari-targeted content still loads

Parse your own User-Agent

The parser analyzes the string you enter in your browser. Paste a User-Agent string or click "Use My User-Agent" to insert your browser's string and inspect reported browser, engine, OS, and device details. The tool bundle loads over the network, and if loading ultimately fails, the site's error report sends your browser's navigator.userAgent to /api/bundles/manage.

User Agent Parser & Analyzer

Parse user agent strings to detect browser, OS, device type, and bots. Analyze Chrome, Firefox, Safari, and Googlebot user agents.

Open the full User Agent Parser & Analyzer tool →
Loading interactive tool...

Where this is heading: User-Agent Client Hints

One way to reduce reliance on the legacy string is User-Agent Client Hints (UA-CH), which provide structured headers in supporting browsers. Some hints are sent by default; sites can request others with Accept-CH:

  • Sec-CH-UA — a low-entropy brand list with intentional "GREASE" noise, e.g. "Chromium";v="120", "Google Chrome";v="120", "Not?A_Brand";v="24". The extra brand is intended to discourage rigid brand matching.
  • Sec-CH-UA-Mobile — a boolean, ?0 or ?1.
  • Sec-CH-UA-Platform — "Windows", "macOS", "Android", etc.
  • Additional hints a site can request: Sec-CH-UA-Platform-Version (which can help distinguish Windows 11 from Windows 10 in supporting browsers), Sec-CH-UA-Full-Version-List, Sec-CH-UA-Arch, Sec-CH-UA-Model.

Alongside this, Chrome's User-Agent Reduction program reduced details in its legacy string: the minor version became 0.0.0, and some platform and device details were fixed or trimmed. Browser support for UA-CH varies, so sites still encounter legacy User-Agent headers. UA-CH provides a more structured way to request information, but its values are client-provided and can be overridden; do not use them as proof for security decisions. See Chrome's UA-CH guidance, MDN's User-Agent reduction guide, and Microsoft's client-hint override documentation.

The User-Agent is client-supplied text and can be spoofed. Use it for progressive enhancement, analytics, and layout hints where an incorrect value has little impact. Neither it nor UA-CH should be relied on alone for access control, licensing, or fraud prevention.

Further reading

Building Something Great?

Our development team builds secure, scalable applications. From APIs to full platforms, we turn your ideas into production-ready software.