User Agent Parser
You have got a user-agent string -- maybe from a log, maybe from a bug report -- and you need to know what browser and device it came from. These strings are a mess of historical baggage and compatibility tokens. Paste it in and get a clean answer.
Paste a user-agent string. See the browser, operating system, and device type.
What is in a user-agent string
A modern Chrome UA string looks like this:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
It mentions Mozilla, AppleWebKit, Gecko, Safari, and Chrome -- even though it is Chrome. That is decades of compatibility shimming. The parser cuts through the noise and tells you: Chrome 120, Windows 10, 64-bit desktop.
What the parser extracts
- Browser -- name and version. Chrome, Safari, Firefox, Edge, Opera, Samsung Internet, and less common browsers.
- Rendering engine -- Blink, WebKit, Gecko, or legacy Trident.
- Operating system -- Windows, macOS, Linux, iOS, Android, ChromeOS, with version where detectable.
- Device type -- desktop, mobile, tablet, or bot.
- Bot flag -- known crawlers (Googlebot, Bingbot, etc.) get flagged automatically.
Confidence scores
Not every UA string is clean. Some are deliberately obfuscated, some are from brand-new browser versions the parser has not seen yet. Each extracted field gets a confidence score. Low confidence means "this is our best guess, do not bet the farm on it."
Practical uses
- Analytics -- segment your traffic by browser and device without writing regex.
- Bug reproduction -- a user reports a bug with their UA string. Parse it, know exactly what environment to test in.
- Bot detection -- the bot flag catches known crawlers. It will not catch custom bots or headless browsers; pair it with rate limiting for anything security-sensitive.
Do not
Do not use user-agent parsing as a security gate. It is trivially spoofed. Anyone can send Googlebot/2.1 as their UA string. Use it for analytics and logging, not access control.