Open any analytics report or server log and you will meet a line like this: a long string of product names, version numbers and brackets that seems to name three browsers at once. It is a user agent string, and almost everyone who has to read one has the same first reaction: why does a visit from Chrome claim to be Mozilla, and what is Safari doing in there too?
This guide explains what that string is, why it looks like a pile of borrowed names, and how to read one properly. It uses the free User Agent Parser on Ovatly, which breaks a string into the four things you usually want from it: browser and version, engine, operating system and device type.
Contents
- Quick answer
- What a user agent string actually is
- Why it is a pile of product names
- How to read one, token by token
- How to parse a user agent string, step by step
- Worked example: a desktop Chrome string
- The Windows 10 or 11 puzzle
- Limitations: a claim, not proof
- Common mistakes
- FAQs
- Conclusion
Quick answer
A user agent string is the self-description a browser sends with every request, naming its browser family, engine heritage, operating system and device class in a single line of tokens. To read one, paste it into the User Agent Parser, or press the button there to load your own browser's string. The parser reports the browser and version, the engine, the operating system and the device type. Read the result as a claim, not a fact: the string is self-reported and can be spoofed.
What a user agent string actually is
When a browser asks a server for a page, it introduces itself in the request headers. That introduction is the user agent string. Servers and analytics tools use it to understand roughly who is visiting: which browser, on which operating system, on what kind of device.
That is why support teams and developers lean on it. It explains an analytics row that looks odd, it lets you reproduce a visitor's bug report on a matching setup, and it lets you check what a crawler claims to be when one shows up in your logs. The key word is claims: the client writes the string, and the client can write anything.
Why it is a pile of product names
The string looks crowded because it is an archaeological record. Early servers served different pages to different browsers, choosing by sniffing the user agent. New browsers that wanted the good pages learned to claim compatibility with browsers the servers already trusted. The claims never got removed, because old sniffing code is still out there.
So every major browser claims Mozilla compatibility, which is why Mozilla/5.0 opens strings from browsers that have nothing to do with Mozilla. Chrome's string also carries WebKit heritage tokens, AppleWebKit and Safari, because Chrome's engine descends from that family tree and servers looked for those tokens. One honest string can therefore name several products, only one of them the actual browser.
This is also why reading order matters. A parser cannot just search for the first familiar name. It has to check tokens in the right order: Edge and Opera are detected before Chrome, and Chrome before Safari, because the later names appear inside the earlier browsers' strings too.
How to read one, token by token
Take the string apart in the order a parser does. First, ignore the opening compatibility claims; they are heritage, not identity. Next, look inside the brackets: that section carries the operating system and platform tokens, such as a Windows version token or a phone family. Then scan the product tokens after the brackets: a browser built on another browser's engine names its parent first and itself later, so the later, more specific token is usually the real browser, version attached. Finally, look for device markers: a Mobile token signals a phone-class device, while its absence alongside a desktop operating system points to a desktop.
You can do this by eye for one string. For a log full of them, or when the tokens are unfamiliar, the parser's token rules do the same job in the right order every time.
How to parse a user agent string, step by step
- Copy the user agent string from your analytics, your logs or the visitor's bug report. To see your own, skip the copying: the tool can load your browser's string for you.
- Open the User Agent Parser and paste the string, or press the button to load your own browser's.
- Read the breakdown: browser and version, engine, operating system and device type.
- Remember the honesty note before you act on it: a user agent is a claim the client makes, and it can be spoofed.
Worked example: a desktop Chrome string
Here is a real-shaped desktop Chrome string:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
The parser reads it as: browser Chrome 120.0.0.0, engine Blink, operating system Windows 10 / 11, device Desktop. Notice what it did not do. It did not report Mozilla, although that name comes first, nor Safari, although that name is present; the token order rules put Chrome ahead of both. The Windows NT 10.0 token gives the operating system, and with no mobile marker the device is a desktop.
A phone string works the same way. An iPhone string with Version/17.2 and Mobile in it parses as Safari on iOS 17.2, device Mobile: the version token supplies the browser version, the bracketed section supplies the system, and the mobile token settles the device type.
The Windows 10 or 11 puzzle
One reading surprises people: a string carrying Windows NT 10.0 is reported as Windows 10 / 11, not as plain Windows 10. That is not the parser being vague. The user agent alone cannot distinguish Windows 10 from Windows 11, because browsers froze that token deliberately rather than updating it. Reporting "10 / 11" is the honest answer the string supports, and any tool claiming certainty here is guessing.
It is a good example of the wider trend. Modern browsers reduce the detail in their user agent strings on purpose, so the string gets less specific over time, not more.
Limitations: a claim, not proof
User agents are self-reported and trivially faked. A bot can present a desktop Chrome string, a browser extension can rewrite the string, and a privacy tool can empty it. Treat results as a good indication, never as proof, and never as the sole basis for blocking a visitor or trusting one.
Detail has limits too. The exact phone model is sometimes in the string, mostly on Android; iPhones and iPads only identify their family, and newer Android versions reduce this detail as well. And the parser does not guess: unknown or future browsers show as Unknown rather than being matched into a wrong answer. Its parsing uses this page's own token rules (Edge, Opera, Samsung Internet, Chrome, Firefox, Safari, Internet Explorer and major bots), not a third-party library.
Common mistakes
- Reading the first name as the browser.
Mozilla/5.0at the front is a compatibility claim shared by nearly everyone, not an identification. - Treating the string as proof of identity. It is a claim the client makes. It supports debugging and rough analytics, not security decisions.
- Assuming Windows NT 10.0 means exactly Windows 10. The token is frozen and covers Windows 11 too.
- Expecting an exact phone model. Often the string names only the family, and modern systems deliberately say less.
- Trusting a crawler's claimed identity at face value. The parser shows what the crawler claims to be; verifying it is a separate job.
FAQs
Why does a Chrome string contain Safari and Mozilla? History. Every major browser claims Mozilla compatibility and includes WebKit heritage tokens so old server sniffing code keeps working. The parser checks tokens in the right order: Edge and Opera are detected before Chrome, and Chrome before Safari.
Can it tell me the exact phone model? Sometimes the model token is in the string, mostly on Android. iPhones and iPads only identify their family, and newer Android versions reduce this detail too.
Is my own user agent sent anywhere? No. Loading your browser's string and parsing it both happen locally on this page.
Why does Windows NT 10.0 show as Windows 10 / 11? Because the user agent alone cannot distinguish Windows 10 from Windows 11. Browsers froze that token deliberately, so the parser reports it honestly as 10 / 11 rather than guessing.
What does the parser show for a browser it does not recognize? Unknown. Unknown or future browsers show as Unknown rather than being guessed into a wrong match.
Conclusion
A user agent string is a short history of the web compressed into one line: compatibility claims at the front, the platform in brackets, and the real browser hiding among borrowed names. Read in the right token order, it gives up its four useful facts quickly: browser and version, engine, operating system and device type. The User Agent Parser applies that order for you, locally, and labels the result with the honesty it deserves. For a different kind of generated text, the guide on How to Turn a Spreadsheet Selection into a Markdown Table shows how grid-built output beats hand-typed syntax. More guides like this one live in the Developer Tools guides archive.