What a User Agent Parser Shows
A user agent string is technical data your web browser transmits with every HTTP request. It usually names the browser and its version, the operating system and sometimes the device or CPU architecture. Much of it is kept for compatibility, and browsers increasingly hide details for privacy.
The HTTP standard (RFC 9110) only defines the basic format, a list of product tokens and comments. What browsers put inside follows convention, not a strict standard. Developers parse these strings for debugging, analytics and log analysis. This parser shows the browser name and version, operating system, device type, rendering engine and, where present, device model and architecture. It also notes what the string cannot tell you, such as Windows 10 versus 11.
How User Agent Detection Works in Web Browsers
Browser Identification via the User-Agent Header
The User-Agent HTTP header identifies browser type (Chrome, Firefox, Safari), version numbers, and rendering engine (Blink, Gecko, WebKit). Servers can read it to adjust responses, though feature detection is the more reliable way to check what a browser supports.
Mobile vs Desktop User Agent Detection
Device classification happens through keywords like "Mobile", "Android", "iPhone", or "iPad" in the UA string. Some servers use this to send a mobile layout, but most sites now use responsive CSS that adapts to the screen instead. Tablets are harder: iPads running Safari report themselves as a Mac by default.
User Agent String Structure: Breaking Down Browser Identifiers
Modern user agent strings contain multiple data points separated by specific delimiters. Understanding each component helps developers implement accurate browser detection scripts and device recognition algorithms.
Product Token (Browser Name)
Identifies the browser: Chrome/120.0, Firefox/117.0, Safari/16.6
Platform Details (OS Information)
Operating system and architecture: Windows NT 10.0; Win64; x64 or Macintosh; Intel Mac OS X 10_15_7
Engine Identifier (Rendering Engine)
Layout engine version: AppleWebKit/537.36, Gecko/20100101
Compatibility Tokens (Legacy Support)
Historical markers: Mozilla/5.0, KHTML, like Gecko for backwards compatibility
Why Parse User Agent Strings? Real-World Applications
Cross-Browser Testing Automation
QA teams parse UA strings to verify cross-browser compatibility across Chrome, Firefox, Safari, and Edge versions. Parsing the UA in test logs confirms which browser and version a run actually used.
Web Analytics & Traffic Analysis
Analytics platforms extract browser and OS data from user agents to generate visitor demographics reports. Teams use these reports to decide which browsers and versions to support.
Bot Detection & Security Filtering
Security systems analyze UA patterns to distinguish legitimate traffic from automated bots, scrapers, and malicious crawlers. The UA alone is weak evidence because any client can send any string, so it is usually combined with other signals such as IP reputation and request patterns.
Device-Specific Responses
Some CDNs and servers vary responses by device class detected from the user agent. Image format choices such as WebP or AVIF are usually based on the browser's Accept header instead.
Working Around Browser Bugs
Feature detection (checking whether an API exists) is preferred, but UA checks are sometimes the only way to target a known bug in a specific browser version. In Chromium browsers, navigator.userAgentData (User-Agent Client Hints) offers a more structured alternative.
User Agent String Examples by Browser and Platform
Below are actual user agent strings from popular browsers. Paste any of them into the parser above to see the breakdown.
Google Chrome 120 on Windows 10/11 (64-bit)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36The Chrome token means the Blink engine (AppleWebKit is a compatibility token). Windows NT 10.0 covers both Windows 10 and 11. Win64; x64 means 64-bit.
Mozilla Firefox 117 on Linux
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0Gecko engine, Linux on x86-64. The distribution (such as Ubuntu) is usually not included. rv:109.0 is frozen in some Firefox versions.
Safari 17 on iPhone (iOS 17)
Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1Mobile identifier present, WebKit engine, iOS version encoded as 17_0
Microsoft Edge 119 on macOS
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0Chromium-based Edge (the "Edg" token). The macOS version is frozen at 10_15_7, so the real version is usually newer.
User Agent Parser FAQ: Common Questions Answered
How do I change my browser's user agent string?
In Chrome or Edge, open DevTools, then More tools → Network conditions and untick "Use browser default" under User agent. Firefox and Safari have similar options in their developer settings. Browser extensions like "User-Agent Switcher" provide GUI controls. Developers use this technique called user agent spoofing to test mobile layouts on desktop or simulate different browser versions during QA testing.
Can websites detect if I spoofed my user agent?
Yes. Advanced fingerprinting compares the UA string against actual browser capabilities detected through JavaScript APIs. If your UA claims to be Safari but the browser supports Chrome-only features, the mismatch can be detected. Chromium browsers also send User-Agent Client Hints API headers that may not match a changed UA string.
Why do Chrome user agents contain "Safari" and "Mozilla"?
Browser history explains this quirk. Early websites checked for "Mozilla" to detect Netscape. When other browsers emerged, they added "Mozilla" for compatibility. Chrome includes "AppleWebKit" and "Safari" because it started out on WebKit, Safari's engine, and kept the tokens after moving to its own Blink engine in 2013. These compatibility tokens prevent legacy sites from blocking modern browsers they don't recognize.
What user agent strings do search engine crawlers use?
Google uses several, including Googlebot/2.1 (desktop and smartphone variants) and Googlebot-Image. Bing uses bingbot. Because anyone can copy these strings, verify real crawlers with a reverse DNS lookup, as Google describes. Use robots.txt rules to control what crawlers may access.
Is user agent sniffing better than feature detection?
No. Modern web development prioritizes feature detection (checking if APIs exist) over UA parsing because browsers can lie about their identity. However, UA sniffing remains useful for analytics, bot detection, and serving mobile-specific content when feature detection isn't practical. Combine both approaches for robust cross-browser support.
Related Web Development Tools
How to Access User Agent Data: Code Examples
Developers can extract user agent information through multiple methods depending on whether you're working server-side or client-side.
Server-Side Detection (HTTP Headers)
app.get('/api/detect', (req, res) =62 123 const ua = req.headers['user-agent']; console.log(ua); 125);$userAgent = $_SERVER['HTTP_USER_AGENT']; echo $userAgent;Server-side parsing happens before page rendering, enabling conditional content delivery based on device type.
Client-Side Detection (JavaScript)
const ua = navigator.userAgent; const isMobile = /Mobile|Android|iPhone/i.test(ua);navigator.userAgentData?.getHighEntropyValues( ['platform', 'platformVersion'] ).then(data =62 console.log(data));JavaScript detection allows dynamic UI adjustments after page load without server requests.
HTTP Request Example with User-Agent Header
GET /api/data HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Connection: keep-aliveEvery HTTP request automatically includes the User-Agent header, making it available to web servers for processing.
Start Parsing User Agent Strings Now
Free, with no sign-up. Paste a string or check your own browser above.