User Agent Parser
Parse any User-Agent string to extract browser, OS, device type, and rendering engine.
What Is a User-Agent String?
The User-Agent (UA) string is sent in the User-Agent HTTP request header and identifies the client software making the request. It typically contains information about the browser, its version, the rendering engine, the operating system, and sometimes device-specific tokens. Servers use this information to serve optimized content, log analytics, and sometimes detect bots and crawlers.
Anatomy of a Chrome User-Agent
A typical Chrome UA on Windows looks like: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
- Mozilla/5.0 — legacy compatibility token (all modern browsers include this)
- (Windows NT 10.0; Win64; x64) — OS and architecture
- AppleWebKit/537.36 — rendering engine (Blink is WebKit-based)
- (KHTML, like Gecko) — compatibility token for Gecko-based browser detection
- Chrome/120.0.0.0 — browser name and major version
- Safari/537.36 — included because Chrome is WebKit-based
Mobile User-Agents
Mobile browsers include device-specific tokens: Mobile or Android for Android, and platform strings for iOS Safari. Android Chrome UA strings include the Android version and device model in the platform section. iOS Safari includes iPhone or iPad followed by CPU and iOS version information. These tokens are used by responsive web design to identify mobile vs. desktop contexts, though CSS media queries are the modern approach.
Bot and Crawler Detection
Search engine crawlers and monitoring bots typically identify themselves in their UA strings. Googlebot uses Googlebot/2.1, Bingbot uses bingbot/2.0, and DuckDuckGo uses DuckDuckBot/1.0. Web scrapers and malicious bots sometimes spoof legitimate browser UA strings. Checking for the bot, crawl, or spider token is a common first-pass heuristic, but reliable bot detection requires IP verification against known crawler IP ranges.
User-Agent Reduction and Client Hints
Starting with Chrome 101, Google began reducing the User-Agent string to improve privacy. The frozen UA string shows a generic OS version and frozen minor version numbers. The replacement is the User-Agent Client Hints API — servers can opt in to receive detailed information via Sec-CH-UA headers using the Accept-CH response header. This shift means traditional UA string parsing is increasingly unreliable for precise version detection. For analytics, use tools like HTTP Header Inspector to examine request headers from your server logs.