Analyse
User Agent Parser
The user agent parser decodes browser User-Agent strings into their structured components: browser name and version, rendering engine, operating system and version, device type and model. Paste any UA string to get an immediate, human-readable breakdown. This is essential for debugging browser compatibility issues, analyzing web traffic logs, and building UA-based conditional logic.
What is a User Agent Parser?
A User-Agent (UA) string is a header sent by browsers and HTTP clients with every request, identifying the software making the request. UA strings contain encoded information about the browser, rendering engine, operating system, and device in a structured but complex format. Parsing them manually is error-prone due to historical quirks and intentional deception (many browsers include 'Mozilla/5.0' for compatibility reasons). A UA parser uses a curated regex database to extract the meaningful components reliably.
How does it work?
Paste a User-Agent string into the input field and click Parse. The tool matches the string against a database of known UA patterns (based on ua-parser2 or similar libraries) and extracts the browser family and version, the rendering engine (Blink, Gecko, WebKit), the OS family and version, and the device category (desktop, mobile, tablet, bot). Detected bots and crawlers are flagged separately. The result is shown as a structured breakdown and as a JSON object you can use in your code.
Typical Use Cases
- Debugging a bug reported by a user by understanding their exact browser and OS
- Analyzing web server access logs to identify top browsers and devices
- Building UA-based conditional logic for feature detection or analytics
- Detecting bots and crawlers in incoming HTTP traffic
Step-by-step Guide
- Step 1: Paste a User-Agent string into the input field.
- Step 2: Click Parse to extract the components.
- Step 3: Review the browser, engine, OS, and device breakdown.
- Step 4: Copy the JSON output for use in your application.
Example
Input
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.1
Output
Browser: Safari 17.0 | Engine: WebKit | OS: iOS 17.0 | Device: iPhone (mobile)
Tips & Notes
- Never rely solely on UA string parsing for security decisions — UA strings can be spoofed trivially.
- Use feature detection (e.g., Modernizr or CSS @supports) in addition to UA-based logic for browser capability checks.
- Log UA strings in your access logs for post-hoc analytics, but use server-side parsing for real-time decisions.
Frequently Asked Questions
Why do all browsers include 'Mozilla/5.0' in their UA string?
This is a historical compatibility artifact. Early browsers included 'Mozilla/5.0' to receive the same content as Netscape Navigator. Subsequent browsers copied it to avoid being sent degraded content, and the pattern has persisted for decades.
Are User-Agent strings reliable for browser detection?
They are useful but not definitive. Users can change their UA string with browser extensions, and some privacy browsers actively report false UA strings. Feature detection via JavaScript APIs is more reliable for capability checks.
User Agent Parser
Detect and analyze browser, engine, operating system, CPU architecture, and device type from any user agent string.
Open Tool