How-to guide

How to Read a User Agent String

A user agent string is a list of product tokens that accumulated for compatibility rather than clarity. Every browser begins with Mozilla/5.0 because of 1990s server sniffing, and most claim several rendering engines they do not use. Read it right to left: the last tokens usually identify the real browser, and everything before them is inherited noise.

User-Agent Parser

Decode a user-agent string into browser, engine and platform.

Open the tool

The format is a historical accident. Servers once checked for "Mozilla" before serving frames, so every competing browser added it, and each later browser added the names of its predecessors to avoid being excluded in turn. Nothing has ever been safely removable since.

That history is why the string is unreliable as a source of truth. It is trivially spoofed, frequently reduced for privacy, and increasingly frozen by browsers that report a fixed version regardless of the real one.

Step by step

  1. Ignore the leading Mozilla/5.0

    It appears in effectively every browser and carries no information. Chrome, Firefox, Safari and Edge all begin this way, as do most bots that want to look like a browser.

  2. Read the platform in the first bracket

    The parenthesised section holds the operating system: Windows NT 10.0 for Windows 10 and 11, Macintosh with a version, or Linux, Android or iPhone. Win64 and x64 indicate architecture rather than browser.

  3. Find the real browser at the end

    The last distinctive token usually wins. A string containing Chrome and then Edg is Edge; one containing Chrome and then OPR is Opera. Safari appears in nearly every Chromium string and rarely means Safari.

  4. Treat the version numbers with suspicion

    Safari/537.36 has been frozen for over a decade and identifies nothing. Chrome and Firefox now round or freeze the minor version deliberately, so precise version detection from the string is no longer possible.

  5. Use it for logging, not for decisions

    It is useful for aggregate traffic analysis and for reproducing a reported bug. It is the wrong basis for enabling a feature — test for the capability instead, which works regardless of what the browser claims to be.

Example

A single Edge on Windows string. Four browser names appear; only the last one is true.

User agent

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

What it means

Mozilla/5.0     historical, meaningless
Windows NT 10.0 Windows 10 or 11
AppleWebKit     Chromium engine lineage
Chrome/125      Chromium version
Safari/537.36   frozen, not Safari
Edg/125         the actual browser

Frequently asked questions

Why does every browser say Mozilla?
Because servers in the 1990s checked for it before serving frames, so competitors added the token to avoid being served a degraded page. Once servers depended on it, no browser could safely remove it, and it has been meaningless ever since.
Why does Chrome claim to be Safari?
Chrome was built on WebKit, Safari's engine, and inherited its tokens so that WebKit-targeted pages would work. Chrome later moved to Blink but kept the tokens, because removing them would have broken sites sniffing for Safari.
Can a user agent string be trusted?
No. It is a request header the client chooses, so any value can be sent. Browser extensions, developer tools and every scripted client can change it freely. Treat it as a claim rather than a fact.
How do I tell Edge from Chrome?
Look for the Edg token near the end — deliberately not spelled Edge, to avoid matching older sniffing code. Opera uses OPR similarly. Both also carry Chrome and Safari tokens, so the last distinctive token is the one that matters.
What replaces user agent sniffing?
Feature detection for capabilities, and Client Hints where you genuinely need platform information. Client Hints ask for specific values rather than a single opaque string, and the browser decides what to reveal.

Tools used in this guide

All tools →
All guides →

Last reviewed .