All articles
DeveloperBy Sharafat Ali · Aug 21, 2026 · 4 min read

What Is a User Agent? (And How to Find Yours)

Every time your browser loads a page, it sends a line of text called a user agent that identifies itself to the website. Servers use it to know roughly what browser, operating system, and device you're on. Here's what it is, how to read one, and why you shouldn't fully trust it.

Find yours instantly

Open your browser's developer tools (F12, or Cmd+Option+I on a Mac), switch to the Console tab, type navigator.userAgent and press Enter — your exact user-agent string is printed.

What's inside a user agent?

Take a typical Chrome-on-Windows string:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36

Decoded, it tells the server:

  • Operating system — Windows NT 10.0 (Windows 10/11), 64-bit.
  • Rendering engine — AppleWebKit / Blink.
  • Browser & version — Chrome/120.0.
  • The Mozilla/5.0 and Safari/537.36 bits are legacy tokens almost every browser includes for historical compatibility — they don't mean you're using Firefox or Safari.

Why does the user agent matter?

  • Analytics — sites use it to report which browsers and devices visitors use.
  • Serving the right assets — e.g. a mobile layout for phones.
  • Debugging — reproducing a bug that only happens on a specific browser/OS.
  • Bot detection — crawlers (Googlebot, etc.) identify themselves in the UA.

The catch: user agents can't be fully trusted

A user-agent string is easy to change or spoof — browsers let you override it, and bots often impersonate real browsers. So treat it as a hint, not proof. For deciding what a browser supports, feature detection (checking whether a capability exists) is far more reliable than "UA sniffing."

FAQ

What is my user agent?

It's the exact string your browser sends with every request. To see it, type navigator.userAgent in your browser's developer console.

Why does Chrome's user agent say "Mozilla" and "Safari"?

For historical compatibility. Decades ago sites checked for "Mozilla," so nearly every browser still includes those legacy tokens — they don't indicate the real browser.

Can I change my user agent?

Yes — browser dev tools and extensions can override it. That's exactly why servers can't rely on it for anything security-sensitive.

Is reading a user agent a privacy risk?

On its own it's a broad identifier (browser/OS/device), but combined with other signals it can contribute to fingerprinting.