Instantly parse your user agent string to reveal browser, OS, and device details.
Parse Your User Agent →Every time you open a website, your browser quietly sends a piece of text called the user agent string to the server. This string identifies your browser, operating system, device type, and rendering engine — all the information a website needs to serve you the right version of its content. But user agent strings are notoriously complex and filled with historical baggage that makes them difficult to read at a glance. That's where a user agent parser comes in.
A user agent (UA) string is a line of text that your browser includes in the HTTP request headers whenever it communicates with a web server. It follows a specific format that has evolved over decades of web browser development. A typical modern Chrome user agent on macOS looks like this:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
At first glance, this seems chaotic — why does Chrome claim to be Mozilla, Safari, and AppleWebKit all at once? The answer lies in the history of the web. In the mid-1990s, browsers competed by adding proprietary features, and websites started serving different content based on which browser was detected. To avoid being locked out, browsers began mimicking each other's user agent strings, creating the layered, confusing format we still use today.
Despite the apparent chaos, user agent strings follow a predictable structure. Breaking down the Chrome example above:
Mozilla/5.0 — Historical compatibility token. Almost every browser starts with this because of Netscape Navigator's early dominance.(Macintosh; Intel Mac OS X 10_15_7) — Platform information: the device and operating system. This tells the server you're on a Mac running macOS Catalina or later.AppleWebKit/537.36 — The rendering engine version. AppleWebKit is used by Chrome, Safari, Edge, and many other browsers.(KHTML, like Gecko) — More compatibility tokens indicating the engine behaves like KHTML (from Konqueror) and Gecko (from Firefox).Chrome/120.0.0.0 — The actual browser identification: Chrome version 120.Safari/537.36 — Another compatibility token to ensure Safari-specific websites still work correctly.A user agent parser extracts the meaningful information from this mess and presents it in a clean, structured format: Browser = Chrome 120, OS = macOS 10.15.7, Device = Desktop, Engine = Blink.
Each major browser has a distinctive user agent pattern, even though they all share some common tokens:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome's UA contains "Chrome/" followed by the version number. It also includes AppleWebKit (the engine it forked from) and Safari tokens for compatibility.
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:121.0) Gecko/20100101 Firefox/121.0
Firefox uses its own Gecko engine, so you'll see "Gecko/" and "Firefox/" in the string. Unlike Chrome, it doesn't include AppleWebKit or Safari tokens.
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2 Safari/605.1.15
Safari's UA is notable for using "Version/" instead of a browser-specific token. It includes AppleWebKit but notably does not include a "Chrome/" token.
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0
Edge switched to the Chromium engine in 2020, so its UA is nearly identical to Chrome's, with the addition of "Edg/" to identify itself.
Mobile user agents include additional tokens that identify the device. For example, an iPhone's Safari UA includes "iPhone" and "Mobile/", while Android browsers include "Android" and the device model. These tokens help websites serve mobile-optimized layouts.
User agent parsing serves several important purposes across different fields:
Developers parse user agents to deliver browser-specific workarounds, test cross-browser compatibility, and debug issues reported by users. When a bug only occurs in a specific browser version, the user agent is often the first clue. QA teams use UA parsing to verify that their applications work correctly across different browser and OS combinations.
Understanding your audience's browser landscape helps prioritize development efforts. If analytics show that 40% of your users are on Safari, you'd better make sure your site renders perfectly in WebKit. User agent data also reveals mobile vs. desktop usage ratios, which informs responsive design decisions and feature prioritization.
User agents are one signal in security systems. Suspicious patterns — like a data center IP claiming to be a mobile Chrome browser — can indicate bot activity or fraud. While UA strings alone aren't reliable for security (they're easily spoofed), they contribute to a broader risk assessment when combined with other signals like IP reputation, behavior analysis, and rate limiting.
Search engine crawlers identify themselves through specific user agent strings (e.g., Googlebot/2.1). Webmasters use UA parsing in server logs to track crawler activity, identify indexing issues, and monitor which pages search engines are visiting. This data is invaluable for technical SEO audits.
The fastest way to parse a user agent is with an online tool like RiseTop's User Agent Parser. Simply visit the page and it automatically detects and parses your current browser's user agent. You can also paste any user agent string manually to analyze it. The tool breaks down the UA into browser name and version, operating system, device type, and rendering engine.
In the browser, you can access the user agent via navigator.userAgent. For parsing, libraries like ua-parser-js provide structured output:
import UAParser from 'ua-parser-js';
const parser = new UAParser();
const result = parser.getResult();
// result.browser: { name: "Chrome", version: "120.0.0.0" }
// result.os: { name: "Windows", version: "10" }
// result.device: { type: "desktop" }
Most web frameworks expose the user agent in request headers. In Python with Flask:
from flask import request
ua_string = request.headers.get('User-Agent')
# Use ua-parser or user-agents library to parse
In Node.js with Express:
const ua = req.headers['user-agent'];
// Use ua-parser-js or detect-browser
The web community has recognized that user agent strings are a problematic approach to browser identification. The emerging solution is User-Agent Client Hints, a structured API that provides the same information in a cleaner, privacy-preserving way.
Instead of sending one long string that contains everything, Client Hints allows servers to request specific pieces of information through HTTP headers. The browser responds with structured, individual headers like Sec-CH-UA (browser), Sec-CH-UA-Platform (OS), and Sec-CH-UA-Mobile (mobile flag). This approach is more accurate, easier to parse, and gives users better control over what information they share.
Chrome has been leading the adoption of Client Hints, gradually reducing the information in the legacy user agent string (a process called "UA freezing"). Firefox and Safari have been more cautious, so for now, developers should support both approaches.
User agent parsing is deceptively difficult due to several factors:
User agent strings are a fascinating artifact of web history — a format shaped by decades of browser competition, compatibility hacks, and evolving standards. While they're imperfect and increasingly being supplemented by Client Hints, they remain a critical tool for web developers, analysts, and security professionals. Whether you need to debug a browser-specific issue, analyze your audience, or simply satisfy your curiosity about what your browser reveals, RiseTop's User Agent Parser makes it effortless to decode any user agent string.
A user agent string is a text identifier that your browser sends to every website you visit. It contains information about your browser name and version, operating system, device type, and rendering engine. Websites use this data to deliver optimized content for your specific setup.
Yes, user agent strings can be easily spoofed using browser extensions, developer tools, or programmatically. This is common in web scraping, testing, and privacy tools. Because UAs are self-reported, they should never be relied upon for security decisions.
This practice dates back to the 'browser wars' of the 1990s. Websites would check for specific browsers and serve different content. To ensure compatibility, browsers started including tokens from other browsers. Modern Chrome user agents still contain 'Mozilla', 'Safari', and 'AppleWebKit' for this historical reason.
Websites use user agent data for analytics (tracking browser market share), responsive design (serving mobile vs. desktop layouts), feature detection (providing fallbacks for older browsers), SEO auditing, and security (basic bot detection). However, modern development favors feature detection over UA sniffing.
User-Agent Client Hints is a newer API that provides structured, granular browser information through HTTP headers and JavaScript APIs, replacing unreliable UA string parsing. It gives servers only the information they explicitly request, improving both accuracy and privacy. Major browsers are gradually adopting this standard.