A user-agent string is the line of text a browser sends with every request to describe itself. Yours is read here by default, or you can paste one from a log to see what it claims to be. The string is picked apart with pattern matching to name the browser, the operating system and whether the device is a handheld.
The important thing about the format is that it is a historical accident rather than a specification. Nearly every browser includes the names of several others for compatibility, which is why a modern Chrome string contains the words Mozilla, AppleWebKit, KHTML, Gecko and Safari alongside Chrome. Detection is therefore an ordered series of guesses, and it can be wrong.
Why detection is unreliable
-
Chromium-based browsers report themselves as Chrome:
Edge, Opera, Brave and Vivaldi all carry Chrome in their string and are identified as Chrome here. Distinguishing them needs the extra token each one adds.
-
The string can be anything at all:
it is set by the client and freely editable. Bots routinely present a browser's string, so it is evidence of a claim, not of a fact.
-
Browsers are actively reducing what they reveal:
version numbers are being frozen and details removed for privacy reasons, so detection that works today will quietly degrade.
-
Detect features rather than browsers:
asking whether a capability exists is accurate now and stays accurate. Asking which browser is in use has never been more than an approximation.
A historical accident, not a specification
A user-agent string is a line of text a browser sends with every request to describe itself, and the [msm_tool slug="user-agent"] picks it apart with pattern matching to name the browser, the operating system, and whether the device is a handheld. The format itself is not a real specification — nearly every browser includes the names of several others purely for compatibility, which is why a modern Chrome string carries the words Mozilla, AppleWebKit, KHTML, Gecko and Safari alongside the word Chrome itself.
Chromium-based browsers all present as Chrome
Edge, Opera, Brave and Vivaldi are all built on Chromium and carry the word Chrome directly in their strings, so they are identified as Chrome by default here. Telling them apart from actual Chrome, or from each other, needs the additional token each one specifically appends to its own string.
The string is a claim, not a fact
Whatever the client sends is entirely under its own control and can be set to anything at all. Bots routinely present a real browser's string rather than announcing themselves, so a user-agent value is evidence of what a client claims to be, never proof of what it actually is.
Browsers are actively revealing less over time
Version numbers are being frozen and identifying details removed for privacy reasons across the major browsers, so detection logic that works correctly today will quietly become less accurate as that reduction continues rather than failing all at once.
Why detecting features beats detecting browsers
Asking whether a specific capability exists is accurate at the moment it is asked and stays accurate regardless of what happens to user-agent strings afterwards. Asking which browser is in use, by contrast, has never been more than an approximation built on a string with no obligation to be honest.