What is a User-Agent?
A User-Agent (UA) is a string sent in HTTP request headers that identifies the client. It traditionally lists the browser name and version, the rendering engine, the OS, and sometimes the device. Servers and analytics tools parse it to know what's hitting them.
UA strings are messy by design
Every browser claims to be Mozilla and most claim to be Safari and most claim to be Chrome. This is for
historical compatibility — sites used to gate features by UA, so every browser added the strings other
browsers needed to look like. The result: UA strings are spaghetti. Parsing them correctly requires a
maintained pattern database, which is what ua-parser-js provides.
UA-CH — the post-UA-string future
Modern browsers are slowly migrating to User-Agent Client Hints (UA-CH) — structured headers that replace the freezing UA string. UA-CH lets servers ask for specific bits (browser brand, OS, mobile flag) instead of parsing one big string. Chrome ships UA-CH; Safari does not yet. Sites that want reliable parsing should use UA-CH where available and fall back to UA-string parsing otherwise. This tool handles UA-string parsing — the legacy lane.
What you can do with parsed UAs
- Analytics — segment users by browser, OS, device. Identify bots before they pollute metrics.
- Bug reports — extract environment info from a customer's "I'm using Safari" support ticket to verify their actual version.
- SEO / crawler analysis — verify your server logs match expected bot patterns.
- Feature gating fallback — modern alternative is feature detection (use
'serviceWorker' in navigatornot "is this Chrome 80+"), but UA-based fallbacks still exist.
Bot detection
The "Bot / crawler" field uses a simple regex against common bot tokens (bot,
crawler, spider, googlebot, bingbot,
chatgpt-user, perplexity, claude). Real-world bot detection is harder
than this — Googlebot can use realistic UAs, scrapers spoof Chrome, and 2026's AI agents (ChatGPT, Claude,
Perplexity) are now major sources of traffic.
Privacy
Your UA is parsed entirely in your browser. The "Use my current UA" button reads navigator.userAgent
and never transmits it anywhere. The library data lives in your bundle.
Related tools
- URL Encoder / Decoder — Percent-encode and decode URLs per RFC 3986.
- JWT Decoder — Decode and inspect JSON Web Tokens. Local-only — tokens never leave your browser.
- Regex Tester — Test regular expressions with live match highlighting and explanation.
- HTTP Status Codes — Full HTTP status code reference with explanations and when to use each.
Related articles
- 4 min readUser-Agent Client Hints — Modern Browser Detection Without UA SniffingUser-Agent Client Hints replace UA string parsing with structured HTTP headers. Learn how Sec-CH-UA headers work, how to request high-entropy hints, and how to use the...
- 4 min readHTTP User-Agent Header — Format, Parsing, and Common ValuesThe User-Agent header identifies the client making an HTTP request. Learn its format, why parsing it is unreliable, common browser UA strings, and how to use it for device...
- 5 min readBot Detection Using User Agent Strings — Googlebot, Bingbot, and CrawlersIdentify search engine crawlers, social media bots, and malicious scrapers from user agent strings. Includes patterns for Googlebot, Bingbot, common bots, and how to verify...
- 5 min readBrowser Detection in JavaScript — Feature Detection vs User Agent ParsingDetect browsers, OS, and device type in JavaScript using user agent strings, feature detection, and the modern Client Hints API. Includes when to use each approach and common...
- 4 min readDevice Type Detection — Mobile, Tablet, Desktop in JavaScriptDetect whether a user is on mobile, tablet, or desktop using user agent strings, CSS media queries, and pointer media features. Includes reliable JavaScript methods and...
- 4 min readMobile User Agent Detection — iOS, Android, and Common PatternsDetect iOS and Android devices from user agent strings. Includes UA patterns for iPhone, iPad, Android phones and tablets, WebView detection, and how iOS 13+ iPadOS changed...
Pillar
Part of Dev Productivity.
Written by Mian Ali Khalid. Last updated 2026-05-13.