What is a user agent and what can you read from it?
The user agent is a text string that a browser, an app or a bot sends in the User-Agent header of every HTTP request. It says what is making the request: a browser and its version, the rendering engine, the operating system, sometimes the device model and the CPU. Servers and analytics tools read it to count visits by browser, to serve a mobile layout, to find out why a feature fails on one system, or to tell a human from a crawler.
The string is hard to read by eye because of history. Nearly every browser starts with Mozilla/5.0 and mentions several rivals (AppleWebKit, KHTML, like Gecko, Safari) so that old sites would serve them the full page. A user agent that ends in Safari/537.36 can be Chrome, Edge, Opera or an Android WebView. The parser here applies rules to pull out the real browser name and version, the engine, the OS, the device and the CPU architecture, so you do not have to decode it yourself.
It runs in your browser with the open-source ua-parser-js library, and the string you paste is not uploaded. Beyond what the library does, the tool recognises well-known crawlers and HTTP clients (search engines, link preview bots of social networks, AI crawlers, SEO crawlers, curl, Python and Go clients, headless Chrome) and tells you what kind of bot it is, which a plain browser parser leaves blank. The link preview bots are the ones that read the tags made by the Open Graph generator.
How to parse a user agent string
- Open the page: the box starts with the user agent of your own browser, so you already see your result. Use My browser to go back to it at any time.
- To parse another one, paste it in User agent string. Take it from a server log, an analytics report, a support ticket or the network tab of the developer tools. Paste the whole value of the header, without the name
User-Agent:. - Or pick one of the examples next to Try: Chrome on Windows, Safari on iPhone, Firefox on Linux, an Android phone or Googlebot.
- Read the cards. Browser and Engine show name and version, OS shows the system, Device shows model, type and vendor, and CPU shows the architecture. A card says "not detected" when the string does not have that information.
- If the string belongs to a crawler or a script, a Bot or crawler card appears with its name and what kind it is. A bot that gives no browser details, such as Googlebot, shows only that card.
- Use Copy result as JSON to take the whole result with you.
If nothing at all is recognised, the page says that the user agent was not recognised and suggests checking that you pasted the entire header value.
Examples
Chrome on Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36Result: browser Chrome 120.0.0.0, engine Blink 120.0.0.0, OS Windows 10, no device, CPU amd64. Windows 11 also says Windows NT 10.0, so the string cannot tell Windows 10 from 11, and the 0.0.0 at the end of the Chrome version comes from Chrome reducing the detail it reveals.
Safari on an iPhone
Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1The copied JSON is:
{
"browser": { "name": "Mobile Safari", "version": "17.2", "major": "17" },
"engine": { "name": "WebKit", "version": "605.1.15" },
"os": { "name": "iOS", "version": "17.2" },
"device": { "vendor": "Apple", "model": "iPhone", "type": "mobile" },
"cpu": {}
}The string says like Mac OS X for historical reasons, but the OS is iOS.
Android, and the browsers that look like Chrome
Mozilla/5.0 (Linux; Android 14; Pixel 8) ... Chrome/120.0.0.0 Mobile Safari/537.36 gives Chrome, Blink, Android 14 and a device with vendor Google, model Pixel 8 and type mobile. Add Edg/120.0.0.0 at the end of a Windows string and the browser is reported as Edge, not Chrome, because Edge also contains the word Chrome. Recent Chrome versions on Android may show a generic model such as K instead of the real device.
Googlebot
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)The page shows "Bot or crawler: Googlebot", described as a search engine crawler, and hides the empty browser cards. The +http://... part is the address where the crawler describes itself.
Common problems and how to fix them
- This user-agent was not recognized: the string is empty, cut or not a user agent. Check that you copied the full header value and not only part of a log line.
- The OS is the same for Windows 10 and 11: both send
Windows NT 10.0. To tell them apart a site needs the newer client hints, not the classic string. - macOS shows 10.15.7 even on a recent Mac: Safari and Chrome freeze that number to protect privacy. The real macOS version is not in the string.
- The device model is missing or generic: browsers reduce what they reveal, and desktops have no model at all, so the Device card may say not detected.
- A bot is not named: the tool knows the common crawlers and any name containing
bot,crawler,spiderorscraper; others look like ordinary browsers. A bot can also lie, so do not use the string alone to grant or block access. - Do you need your own device details too? The device information page shows screen, time zone and language next to the user agent of your browser.
Frequently asked questions
What is my user agent?
The box opens with the user agent of the browser you are using, and My browser brings it back. It is the same string that every site you visit receives in the request header.
Why do all user agents start with Mozilla/5.0?
For compatibility. Early web servers sent the full page only to Netscape (nicknamed Mozilla), so every later browser started claiming to be Mozilla and added the names of the others. It is a token that no longer means anything.
Can I trust the user agent to detect a device?
Only as a hint. The client can change it in a second, and browsers are reducing the information in it. For layout, use CSS media queries and feature detection; the user agent is for statistics, logs and diagnosis. Compare with the status of requests in HTTP status codes when a bot gets blocked.
What are User-Agent Client Hints?
A newer mechanism in Chromium-based browsers that gives the same facts in separate headers and in navigator.userAgentData; the detailed ones are sent only when the site asks for them. It is the long-term replacement for the string, but the classic header is still sent.
Doing it in code
JavaScript
import { UAParser } from 'ua-parser-js';
const ua = 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Mobile/15E148 Safari/604.1';
const result = new UAParser(ua).getResult();
console.log(result.browser.name, result.os.name, result.device.model);
// Mobile Safari iOS iPhoneBash
# See how a server answers to a crawler: send the user agent you want to test
curl -s -o /dev/null -w "%{http_code}\n" -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://example.com/