User Agent Parser

See your own user agent, or parse any UA string into browser, OS, device and engine.

User Agent Parser: What Is My User Agent? Browser, OS and Device from a UA String

When the page opens, the box already contains your own user agent string, the text your browser sends with every request, and the result below shows what it says: browser name and version, rendering engine, operating system, device type and vendor, and CPU architecture. Paste any other user agent, from a server log, an analytics export or a bug report, to parse it the same way. Parsing happens in your browser with the open-source ua-parser-js library; nothing is sent to a server.

What a user agent string contains

Every HTTP request from a browser carries a User-Agent header. It follows a pattern inherited from the 1990s, when every browser claimed to be "Mozilla" to receive the pages Netscape got:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36
└─ legacy ─┘ └──── platform ─────────┘ └──── engine ────────────────────┘ └ browser ──┘ └ legacy ┘

browser  Chrome 140.0.0.0     engine  Blink 140.0.0.0
os       Windows 10           cpu     amd64

The parser recognises the real browser behind the compatibility tokens: a string containing Safari is Chrome if it also contains Chrome, and Edge if it contains Edg. That order of checks is why hand-written parsing with includes('Safari') goes wrong so often.

The result is the raw JSON from ua-parser-js, with browser, engine, os, device and cpu objects, and empty objects are normal. A desktop browser gives "device": {}, because the library only fills in a device type for phones, tablets and similar hardware. A reduced Android string gives "model": "K", the placeholder Chrome now sends instead of the phone's name, and Chrome on a phone is reported as Mobile Chrome. Crawlers, curl and scripts come back with every object empty.

Why the version and OS may look wrong

Browsers deliberately send less information than they used to. Since 2022, Chrome and other Chromium browsers have reduced the user agent: the minor version is always 0.0.0, the Android device model is replaced with K, and the OS version is frozen. Every Mac reports Mac OS X 10_15_7 whatever macOS it runs, a Chromebook reports CrOS x86_64 14541.0.0 whatever ChromeOS version it has, and Windows 11 reports Windows NT 10.0, exactly like Windows 10. Safari on macOS froze its OS version too, and iPadOS Safari presents itself as a Mac by default.

So a result of "Windows 10" or "macOS 10.15.7" from a modern browser is not an error in the parser; the information is simply not in the string. Chromium browsers expose more detail through User-Agent Client Hints, the Sec-CH-UA headers and navigator.userAgentData.getHighEntropyValues(), which can return the real platform version, so Windows 11 is detectable that way. Firefox and Safari do not implement client hints.

Reading user agents from logs

Server logs and analytics exports contain user agents of real visitors and of automated clients. Paste one to see whether a spike of errors comes from an old Android WebView, a single browser version after an update, or a script. Typical non-browser values look like this:

curl/8.9.1
python-requests/2.32.3
Go-http-client/2.0
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
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

Crawler strings are not classified as browsers by the parser, so their browser fields stay empty; the name of the bot is right there in the text. Keep in mind that the user agent is chosen by the client and can be anything. Anyone can send Googlebot in the header, so Google recommends verifying its crawler by a reverse DNS lookup of the IP address, not by the user agent.

Detect features, not browsers

Using the user agent to decide what a page can do breaks as soon as a browser changes its string, and it wrongly excludes browsers you did not test. Check for the feature instead:

if ('share' in navigator) { /* Web Share API is available */ }
if (CSS.supports('display', 'grid')) { /* … */ }
const isTouch = matchMedia('(pointer: coarse)').matches;

User agents are still the right tool for analytics, for diagnosing bug reports ("which browser was this?"), for blocking or rate-limiting specific automated clients, and for serving a workaround to a known broken browser version. For layout, use CSS media queries rather than device detection.

Checking and changing the user agent

navigator.userAgent                         // JavaScript in the browser
$_SERVER['HTTP_USER_AGENT']                 // PHP
request.headers.get('user-agent')           // Node.js / Fetch API
curl -A 'MyBot/1.0 (+https://example.com)' https://example.com

To test how a site responds to another device, open Chrome DevTools, choose More tools > Network conditions, untick Use browser default and pick or type a user agent. The device toolbar also switches the user agent along with the screen size. If you write a crawler or API client, send an honest user agent with a name, version and contact URL, so site owners can identify you instead of blocking an anonymous client.

Privacy

The user agent is one of the signals used for browser fingerprinting, together with screen size, installed fonts and time zone, and limiting that was the main reason Chrome reduced it. On its own the string is shared by everyone running the same browser version on the same system, so it rarely points to one person; combined with the other signals, it narrows the crowd quickly.

Frequently asked questions

What is my user agent?

Your current user agent string is shown in the box at the top of the tool as soon as the page loads, together with the browser, operating system and device it describes.

Why does my Windows 11 PC show Windows 10?

Browsers send Windows NT 10.0 for both Windows 10 and 11, so the user agent cannot tell them apart. Chromium browsers reveal the real version only through User-Agent Client Hints.

Why does Chrome's version end in .0.0.0?

Chrome reduced its user agent to limit fingerprinting: only the major version is real, and the rest is fixed. The same applies to the macOS and Android details.

Can I trust the user agent to identify bots?

No. Any client can send any user agent. Verify search engine crawlers with a reverse DNS lookup of the requesting IP address.

How do I change my user agent in Chrome?

Open DevTools, go to More tools > Network conditions, untick Use browser default and select or enter another user agent. It applies only while DevTools is open.

Is my user agent stored?

No. It is read and parsed in your browser only, and nothing is sent to or saved on a server.