# User-Agent Parser

> Break a User-Agent string down into browser, engine, OS and device.

- Page: https://decoder.tools/user-agent-parser
- Category: Network, System & Packets
- Status: live, runs in the browser
- Last reviewed: 2026-10-23

A User-Agent parser interprets the User-Agent HTTP header — a string every browser sends identifying itself — extracting the actual browser, its version, the rendering engine and the operating system from a format thick with historical compatibility tokens.

## Example

```text Input
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36
```

```text Output
Chrome 120.0 on macOS 10.15.7
Browser: Chrome 120.0
Operating system: macOS 10.15.7
Engine: WebKit/Blink
Form factor: Desktop
```

## What is the User-Agent Parser?

User-Agent strings are an accident of history. Nearly every browser still begins with 'Mozilla/5.0' because early servers sniffed for it, and Chrome's string names Safari and KHTML for the same reason. The result is a header where almost every token is a compatibility claim rather than a fact, and parsing it means knowing which tokens to believe.

The reliable signals are the later ones: 'Chrome/120' before 'Safari' means Chrome; 'Version/17' before 'Safari' with no Chrome token means real Safari; 'Firefox/121' means Firefox; 'Edg/120' means Edge. Getting this wrong is how sites end up serving Safari-specific workarounds to Chrome.

The header is also being deliberately wound down. Chrome now freezes and reduces the detail it reports, moving to Client Hints (Sec-CH-UA headers) where sites request only what they need. Feature detection has always been the better approach; UA parsing remains useful for analytics, log analysis and bot identification.

## How to use the User-Agent Parser

1. Paste the User-Agent string from a log line or your browser's network tab.
2. Read the identified browser, version, engine and operating system.
3. Treat the result as a hint — the header is self-reported and freely faked.

## When to use it

- Analysing which browsers and versions appear in your access logs.
- Identifying bot and crawler traffic by its declared agent.
- Reproducing a bug reported by a user who pasted their UA string.

## User-Agent Parser at a glance

| | |
|---|---|
| Header | User-Agent, sent on every HTTP request |
| Mozilla/5.0 | A legacy compatibility token, not a real claim |
| Successor | User-Agent Client Hints (Sec-CH-UA) |
| Trustworthy? | No — trivially spoofed by clients and bots |

## FAQ

### Why does Chrome's User-Agent mention Safari and Mozilla?

Purely for backward compatibility with servers that once sniffed for those tokens. The string is a chain of historical claims; only the later, browser-specific tokens are meaningful.

### Can a User-Agent be trusted?

No. It is a self-reported string any client can set to anything, which is why it should never gate security decisions — and why bots routinely present as ordinary browsers.

### What replaces the User-Agent header?

User-Agent Client Hints: a set of Sec-CH-UA headers a site can request, giving structured, granular data with less passive fingerprinting surface than one long string sent to everyone.
