~/tools/user-agent

> user agent

parse your browser's user-agent string into browser, os, device, and rendering engine. reads navigator.userAgent and shows what a server would see.

## overview

the user-agent string is an http header that browsers send on every request to identify themselves. it is a fossil: started as `mozilla/5.0` to pretend to be netscape, then grew rendering engine markers, then os markers, then device markers, and now contains vendor strings for chrome, safari, edge, firefox, and their forks. parsing it is brittle — vendor changes shift the output format, and the same browser can look different on different devices. this tool reads the string directly from navigator.userAgent and parses out: browser name and version, rendering engine (blink/webkit/gecko), os and version, and device hints (mobile/tablet/desktop). useful for debugging device-specific bugs, confirming what identity your browser exposes, and testing ua sniffing. google has been telling developers for years to use feature detection instead of ua sniffing, but ua remains useful for analytics and diagnostics.

## how to use

  1. load the pagethe tool reads your ua on load — nothing to input.
  2. inspect the parsed fieldsbrowser, os, device, engine are broken out.
  3. copy the raw stringthe full navigator.userAgent is shown with a copy button for use in bug reports.
  4. compare across devicesopen the page on a different browser or device to see the difference.

## examples

$ example 1 — standard desktop chrome
$ in
mozilla/5.0 (macintosh; intel mac os x 10_15_7) applewebkit/537.36 (khtml, like gecko) chrome/131.0.0.0 safari/537.36
# out
chrome 131, blink, macos 10.15.7, desktop
$ example 2 — safari on iphone
$ in
mozilla/5.0 (iphone; cpu iphone os 17_4 like mac os x) applewebkit/605.1.15 version/17.4 mobile/15e148 safari/604.1
# out
safari 17.4, webkit, ios 17.4, mobile
$ example 3 — bot, not a browser
$ in
mozilla/5.0 (compatible; googlebot/2.1; +http://www.google.com/bot.html)
# out
googlebot 2.1, crawler

## common mistakes

  • user-agent reductionmodern browsers emit a reduced ua string and expose detail via sec-ch-ua client hints instead. what you see is intentionally coarse.
  • spoofingthe ua can be changed in devtools or by extensions. treat it as a hint, not a guarantee.
  • ua-only bot detection is unreliableattackers set whatever ua they want. combine with behaviour signals for real bot detection.
  • legacy cruft`mozilla/5.0` is meaningless; every modern browser claims it. the useful parts are after the first paren.
  • brand fragmentationchromium-based browsers (edge, brave, opera, arc) all include `chrome` plus their own marker. parse for the vendor-specific marker last.

## faq

does this send my ua anywhere?

no. parsing runs in your browser.

why does chrome say `safari` at the end?

historical compatibility. chrome's ua claims safari so old ua-sniffing code that only looked for 'webkit' or 'safari' still works.

what are user-agent client hints?

a newer mechanism (sec-ch-ua headers) that exposes browser, platform, and architecture separately and negotiates which fields to send.

can i change my ua?

yes — in devtools → network conditions → user agent. also via extensions. servers have no way to tell if you have changed it.

is ua reliable for feature detection?

no. use `in` checks, CSS @supports, or function/feature probes. ua sniffing is fragile.

why does my parser disagree with another?

ua parsing is heuristic. two parsers with different rule sets can disagree on the same input. we use ua-parser-js under the hood.

can ai agents call this over mcp?

yes — user_agent_parse on the mcp endpoint at drwho.me/mcp/mcp.

## related tools

  • http headers inspect the http request headers your browser sends.
  • what is my ip your public ip address, location, and timezone.

## references

  1. RFC 9110 — http semantics (user-agent header)
  2. MDN — navigator.userAgent
  3. WICG — user-agent client hints
ad slot · tool-user-agent