User-agent parser
Detect and parse Browser, Engine, OS, CPU, and Device type/model from an user-agent string.
Enable JavaScript to use the interactive tool. The guide below explains how it works.
User-Agent Parser: Decode and Understand Browser Identifiers
The User-Agent (UA) string is one of the most complex and historically burdened headers in the HTTP protocol. Originally intended to provide simple information about the client's browser and operating system, years of "browser wars" have turned it into a convoluted string filled with legacy compatibility tokens and contradictory information. The User-Agent Parser tool is designed to cut through this noise, providing a structured, easy-to-read breakdown of what any UA string actually means.
1. What the Tool Does
The User-Agent Parser takes a raw User-Agent string—either from your current browser or one you paste in—and instantly extracts the core technical details. It identifies the Browser (and its version), the Operating System, the Rendering Engine, and the Device Type (Mobile, Tablet, Desktop, or Bot). This transformation from a messy string to structured data allows developers to quickly understand the environment of a specific user or test their application's client-detection logic.
2. Why Developers Use It
- Debugging Client-Specific Issues: When a user reports a bug that only happens on "Chrome 115 on Android 13," you can use this tool to verify exactly what that UA string looks like and ensure your code is handling it correctly.
- Bot Detection: Verify if a specific UA string belongs to a legitimate crawler like
Googlebotor a common library likepython-requests. - Analytics Verification: Ensure that your analytics platform (like Google Analytics or Matomo) is correctly categorizing devices by testing the UA strings it receives.
- Technical Research: Understand the "compatibility lying" that modern browsers do (e.g., why Chrome's UA string still mentions "AppleWebKit" and "Safari").
3. Step-by-Step Instructions
- Navigate to the User-Agent Parser tool.
- By default, the tool shows the information for your current browser.
- To parse a different string, paste the raw User-Agent into the input field at the top.
- Review the generated cards which display:
- Browser Details: Name and major/minor version.
- OS Details: Operating system name and version.
- Engine Details: The rendering engine (e.g., Blink, Gecko, WebKit).
- Device Info: Manufacturer, model, and type.
- Use the "Copy" icon on any field to grab specific details for your reports or code.
4. Examples
- Modern Chrome on Windows:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36- Result: Browser: Chrome 120, OS: Windows 10, Engine: Blink.
- iPhone Safari:
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- Result: Browser: Safari 17, OS: iOS 17, Device: iPhone.
5. FAQs
Q: Why do all User-Agent strings start with "Mozilla/5.0"? A: This is a legacy remnant. In the early web, servers would check for the "Mozilla" token to decide whether to serve advanced features. To ensure compatibility, every subsequent browser (including IE, Chrome, and Safari) started their strings with "Mozilla/5.0" to avoid being blocked.
Q: Can I trust the User-Agent string for security? A: No. The User-Agent string is entirely client-controlled and can be easily "spoofed" (faked). Never use it for sensitive security decisions; use it only for UI hints, analytics, and debugging.
6. Common Mistakes
- Simple Keyword Matching: Don't write code like
if (ua.includes("Safari"))to detect Safari. Because Chrome also includes the "Safari" token for compatibility, this will lead to incorrect detection. Always use a proper parsing library or this tool. - Ignoring Version Numbers: Detecting just "Chrome" is often not enough, as many bugs are specific to older versions. Always check the version metadata provided by the parser.
7. Real-World Use Cases
- Progressive Enhancement: Serving a simpler version of your site to legacy browsers (like IE11) while providing modern features to the latest versions of Firefox or Chrome.
- App Download Buttons: Automatically showing the "Download for Mac" button vs. the "Download for Windows" button based on the visitor's OS.
- Fraud Detection: Identifying when a "mobile user" is actually using a desktop browser with a spoofed User-Agent.
8. Related Tools
- MIME Types: To understand the types of files different browsers can handle.
- HTTP Status Codes: For understanding server responses to different clients.
Decode the identity of any web client with precision.