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.
Pillar
Part of Dev Productivity.
Written by Mian Ali Khalid. Last updated 2026-04-25.