WebPeeks
RFC 9110

User-agent string parser

Paste a User-Agent string from a server log or a request header and see what it says about the browser, engine, operating system and device, and what it no longer can.

Paste-in tool. Your browser cannot fetch another site's headers for a web page (CORS forbids it), and WebPeeks has no server to do it, so nothing you paste leaves your browser. Copy user agents from your access logs or from the User-Agent request header in the browser's Network tab, or press the button below to parse the browser you are using now.

Parsed user agent
BrowserChrome 140.0.0.0
Rendering engineBlink 140.0.0.0
Operating systemWindows 10 or 11
Device typeDesktop or laptop

Notes

  • Info
    Windows 10 and 11 look identical here

    Both send "Windows NT 10.0". Only the Sec-CH-UA-Platform-Version client hint (Chromium browsers, on request) can tell them apart.

  • Info
    Chrome minor version is reduced

    Chromium browsers send only the major version (for example 126.0.0.0). The full version is in the Sec-CH-UA-Full-Version-List client hint.

Common user agents, parsed

A reference set of typical strings, run through the same parser. Note how many of them claim to be Safari, and that Chrome on iPhone reports the WebKit engine.

Parsed asOSEngineUser-Agent string
Microsoft Edge 140 Windows 10 or 11 Blink Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0
Safari 18 macOS 10.15.7 WebKit Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15
Firefox 143 Windows 10 or 11 Gecko Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:143.0) Gecko/20100101 Firefox/143.0
Safari 18 iOS 18.5 WebKit Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1
Chrome 140 iOS 18.5 WebKit Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/140.0.7339.101 Mobile/15E148 Safari/604.1
Chrome 140 Android 10 Blink Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36
Samsung Internet 28 Android 14 Blink Mozilla/5.0 (Linux; Android 14; SAMSUNG SM-S918B) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/28.0 Chrome/130.0.0.0 Mobile Safari/537.36
Googlebot Unknown Unknown Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Bingbot Unknown Blink Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm) Chrome/116.0.1938.76 Safari/537.36
curl Unknown Unknown curl/8.9.1

How the parser works

There is no formal grammar for real user agents. RFC 9110 defines the header as a list of product tokens and comments, but every browser fills it with tokens borrowed from others for compatibility. So the parser looks for distinguishing tokens in a fixed order, most specific first:

  1. Crawlers. Known bot tokens such as Googlebot, bingbot, GPTBot or curl/, then a generic match for words like bot, crawler and spider.
  2. Operating system. Windows NT, iPhone, iPad, Android, CrOS, Mac OS X, then Linux.
  3. Browser. Tokens that only one browser sends come before the ones everybody copies: Edg/ (Edge), OPR/ (Opera) and SamsungBrowser/ before Chrome/, and Chrome/ before Safari/, because Chrome's string also contains Safari and Edge's contains both.
  4. Engine. Anything on iOS is WebKit; Firefox/ means Gecko; a Chrome/ token means Blink; otherwise AppleWebKit/ means WebKit.

A worked example

The pre-loaded string is Chrome on Windows: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36. Reading it piece by piece:

So the most this string reliably says is "Chrome 140, desktop, Windows 10 or later". Everything else is either frozen or borrowed.

User-agent reduction and client hints

From 2021 to 2023 Chrome rolled out user-agent reduction: the minor version, the Android version and device model, and the exact desktop OS version were replaced by fixed values, to cut down on passive fingerprinting. Safari and Firefox had already frozen parts of theirs. The detail is still available to sites that ask for it, through User-Agent Client Hints: Sec-CH-UA headers the server requests with Accept-CH, or navigator.userAgentData in JavaScript. Client hints are supported in Chromium-based browsers only.

Where parsing stops being reliable

Common questions

Why does every user agent start with Mozilla/5.0?

History. In the 1990s some sites sent richer pages only to Netscape (codenamed Mozilla), so other browsers started claiming to be Mozilla to get them. Each new browser then copied the strings of the ones before it: Chrome's says Mozilla, AppleWebKit, KHTML, Gecko and Safari. The prefix means nothing now, but removing it would break sites that still check for it.

Why does my Mac show as macOS 10.15.7 when I have a newer version?

Browsers froze that part of the string. Since macOS 11, Safari, Chrome and Firefox all report 10.15.7 regardless of the real version, partly for privacy and partly because some sites broke when the major version passed 10. The real version is not in the user agent at all.

Can I tell Windows 10 from Windows 11?

Not from the user agent: both send Windows NT 10.0. Chromium-based browsers expose the platform version through the Sec-CH-UA-Platform-Version client hint, which a server must request with an Accept-CH header, or a page can read with navigator.userAgentData.getHighEntropyValues(). Firefox and Safari do not support client hints.

Should my site detect browsers from the user agent?

Rarely. Detecting features (does this browser support X?) is more reliable than detecting browsers, because user agents are frozen, spoofed and copied. Server logs and analytics are the main legitimate uses, along with telling crawlers apart from people, and even then a crawler's claim should be checked against its IP address.

Is a request claiming to be Googlebot really from Google?

Not necessarily; anyone can send that string. Google's documented check is a reverse DNS lookup on the IP address (it should end in googlebot.com, google.com or googleusercontent.com) followed by a forward lookup that returns the same IP, or a match against the IP ranges Google publishes. Bing and most other large crawlers offer similar checks.