SnapSum
← Back to Blog
Developer5 min read

User-Agent Parser - Decode Browser and Device Info from UA Strings

The User-Agent (UA) string is a header that browsers send with every HTTP request, identifying the browser name, version, operating system, and rendering engine. Parsing UA strings helps with analytics, device targeting, and debugging redirects.

Anatomy of a User-Agent String

A typical Chrome UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

  • Mozilla/5.0 - historical compatibility token (almost all browsers include it)
  • Windows NT 10.0 - operating system
  • AppleWebKit/537.36 - rendering engine
  • Chrome/126.0.0.0 - actual browser and version
  • Safari/537.36 - also for compatibility

Why UA Parsing Is Tricky

UA strings are messy and often include compatibility tokens that don't reflect the actual browser. Bot UA strings (Googlebot, Bingbot, ChatGPT-User) have different formats. Mobile vs desktop UAs have different structures.

UA Detection vs Feature Detection

Detecting browsers by UA string is fragile. Modern best practice is feature detection rather than UA sniffing. But UA parsing is still useful for analytics and logging.

Free User-Agent Parser

Use SnapSum User-Agent Parser - paste any UA string, get browser name/version, OS, device type, and bot detection. Also shows your current browser's UA. 100% browser-based.