How to detect Windows 11 from the User Agent string

Traditionally, the User Agent string for most web browsers would include some kind of fragment that indicates which Operating System the Web Browser (i.e. the agent) was running on. It still is very common to see fragments like Windows NT 6.2, iPhone OS 12_2, or Android 8.0.2 in user agent strings, all of which give a reasonable indication of the Operating System being used.

However if you've been looking at the latest user agents for Chrome you may have noticed that this approach has changed with the User Agent strings for browsers running on the new Microsoft Windows 11: The Operating System fragment for Windows 11 still says Windows NT 10.0. Very strange, right?! So can you still accurately detect the version of Windows any more?!

The short answer: You can't detect Windows 11 via the User Agent string

All of the major web browsers that run on Windows won't include Windows NT 11.0 (or similar) fragments in their user agents when running on Windows 11. This will cause websites that use just the user agent for browser detection to not get accurate results.

Instead, the Chromium and Mozilla development teams - the teams who make the engines that power most Windows based web browsers - have declared their intents to "Freeze" the user agent strings for their web browsers, in favor of more modern approaches.

Instead, use "Client Hints" to detect Windows 11

Since you can't use User Agent strings to detect Windows 11, you will now need to use Client Hints headers to Detect Windows 11.

Chrome and Windows 11 User Agent strings

At the start of 2020, there was an intent declared to deprecate and "freeze" the user agent string in Chromium based browsers on the Chromium development discussion group. Their motivation is outlined in the post, but basically they want to reduce the fingerprinting and compatibility issues that can occur when using user agent strings.

Their approach going forward is to use a new standard called "Client Hints", which are a series of HTTP Headers which are to be sent with web requests, along-side the frozen user agent string.

We've been following the development and introduction of Client Hints closely, and have a whole section dedicated to learning about Client Hints - how to use them, what to look out for, and so on.

Firefox and Windows 11 User Agent strings

Firefox is not sending "Windows 11" fragments in their user agent string (Read their discussion), and since Firefox hasn't adopted Client Hints yet, there's actually no way at all for websites to detect that Firefox is running on Windows 11.

This is a frustrating limitation of Firefox at the moment, as it means web developers aren't able to accurately customize their content or get accurate statistical reporting on the visitors to their sites.

Use our API to get the best browser detection possible

The introduction and switch to using Client Hints brings with it lots of quirks, inconsistencies, and extra knowledge requirements in order to accurately detect web browsers and bots on your site. We've been working hard on Version 3 of our Browser Detection API which performs browser detection based on User Agents, Client Hints, Javascript based signals, and IP Addresses. If you need the best detection available, please have a look!

Learn more about Client Hints

To share some of what we've learnt about Client Hints, we've added a new section to our Developers site, to help you Learn About Client Hints. If you need to know more, have a look.