User Agent Parser

Parse and analyze user agent strings to identify browser, operating system, device type, and rendering engine. Detect mobile devices, bots, and crawlers. View detailed information about browser versions, OS versions, and device vendors. Perfect for web developers, analytics, and debugging.

User Agent String

Example User Agents

About User Agent Strings

A user agent string is a text identifier that browsers and applications send to websites, containing information about the device, operating system, and browser being used. Websites use this information to optimize content delivery and track analytics.

How to Use

  1. Enter your value in the input field
  2. Click the Calculate/Convert button
  3. Copy the result to your clipboard

Frequently Asked Questions

What is a user agent string?
A user agent (UA) string is text sent by browsers and applications to web servers, identifying the client software, operating system, and device. Example: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" indicates Chrome 120 on Windows 10. Servers use UA strings for analytics, device detection, and serving optimized content. User agent parsers extract structured information from these strings.
Why do all user agent strings start with "Mozilla"?
All modern browsers include "Mozilla" for historical compatibility. In the 1990s, Netscape Navigator (codenamed Mozilla) dominated, and websites checked for "Mozilla" to serve advanced features. When Internet Explorer launched, it included "Mozilla" to avoid being blocked. This pattern continued: Chrome includes "Safari", Edge includes "Chrome", etc. The UA string became an increasingly complex chain of compatibility tokens rather than a simple identifier.
What information can I extract from a user agent string?
UA parsers extract: browser name and version (Chrome 120, Firefox 115, Safari 17), operating system and version (Windows 10, macOS Sonoma, iOS 17, Android 14), device type (desktop, mobile, tablet), device vendor (Apple, Samsung, Google), rendering engine (Blink, WebKit, Gecko), and bot/crawler detection (Googlebot, Bingbot). Accuracy varies — some clients send minimal or spoofed UA strings. Modern approaches use client hints for more reliable detection.
How do websites detect mobile devices?
Websites parse user agent strings for keywords like "Mobile", "Android", "iPhone", "iPad". Modern approaches use: UA string parsing (traditional, less reliable due to UA spoofing), responsive design with CSS media queries (viewport-based, not UA-dependent), JavaScript detection (navigator.userAgent, screen size), or Client Hints API (modern, server-side device detection). Best practice: design responsively and use UA detection only for analytics or specific feature targeting.
What are browser client hints?
Client Hints are a modern alternative to user agent strings, providing device information via HTTP headers. Instead of parsing long UA strings, servers request specific hints like Sec-CH-UA (browser), Sec-CH-UA-Platform (OS), Sec-CH-UA-Mobile (mobile/desktop). Benefits: better privacy (only requested info sent), more reliable (less spoofing), and structured data (easier parsing). Chrome, Edge, and Opera support client hints; Firefox and Safari adoption is ongoing.
Can user agent strings be spoofed?
Yes, user agents are easily spoofed. Users change UA strings via browser extensions, developer tools, or privacy settings. Bots often impersonate browsers to scrape content or bypass restrictions. Desktop browsers can mimic mobile browsers for testing. For security decisions, never rely solely on UA strings — use server-side validation, fingerprinting, or CAPTCHA. For analytics and optimization, UA parsing is generally sufficient as most users do not spoof.
How do I detect bots and crawlers from user agent strings?
Bot UA strings typically identify themselves: "Googlebot/2.1", "Bingbot/2.0", "Slackbot", "facebookexternalhit". Parser libraries maintain bot databases. However, malicious bots may impersonate browsers. To verify legitimate crawlers, perform reverse DNS lookup (Google's bots resolve to googlebot.com), check IP ranges (published by search engines), or verify via robots.txt. For blocking, use robots.txt, rate limiting, or CAPTCHA rather than UA blocking alone.
What are common user agent parser libraries?
Popular libraries: ua-parser-js (JavaScript, 60K+ GitHub stars, comprehensive), bowser (JavaScript, lightweight), useragent (Node.js), user-agents (Python), ua-parser (multi-language, C core), Woothee (multi-language, fast), Device Detector (PHP, extensive device database), and commercial APIs (DeviceAtlas, WURFL). Choose based on: programming language, database size (more devices vs. smaller footprint), update frequency (new browsers/devices), and performance needs.

Related Tools