User-Agent Parser
Paste a User-Agent string to identify the browser, rendering engine, operating system and device, including modern AI crawlers such as GPTBot and ClaudeBot.
Break a User-Agent string into the browser, rendering engine, operating system and device it claims to be, with a button to inspect your own. AI crawlers are identified specifically, which matters when you are deciding what to allow in robots.txt.
// User-Agent Parser: Features
Why User-Agent strings are so strange
Every modern browser claims to be Mozilla, and most claim to be several other browsers as well. This is historical: sites once served different content based on the User-Agent, so each new browser added the identifiers of its predecessors to avoid being served a degraded page. The result is a string that accumulates lies for compatibility, which is why parsing it requires knowing the order in which to look for the markers rather than simply reading it.
Identifying AI crawlers
The parser specifically recognises the crawlers that have proliferated recently: GPTBot, ChatGPT-User and OAI-SearchBot from OpenAI, ClaudeBot and its relatives from Anthropic, PerplexityBot, Google-Extended, CCBot from Common Crawl, Bytespider, Amazonbot and Applebot-Extended. Whether to allow them is a decision each site makes differently, and identifying which one is hitting you is the first step in making it.
Do not use this for feature detection
Parsing the User-Agent to decide what your code can do is a long-standing mistake. The string can be changed by the user, is routinely spoofed, and tells you what the browser claims rather than what it supports. Feature detection is the correct approach: test for the capability directly. User-Agent parsing is appropriate for analytics, for logging, and for identifying bots, where an approximate answer is genuinely useful.
The string is in decline
Browsers have been reducing the information in the User-Agent for privacy reasons, because the combination of values is a strong fingerprinting signal. Chrome has frozen much of its string, and version and platform detail is increasingly available only through Client Hints, which the server must request explicitly. Expect parsed results to become less specific over time, and treat precise version detection as unreliable for current browsers.
Parsed locally, including your own User-Agent
The parsing runs locally and the string is never transmitted, stored or logged. The button that fills in your own User-Agent reads it from your browser directly. To examine the rest of the headers that came with a request, the HTTP Header Analyzer explains each one and flags weak security settings.
// User-Agent Parser: FAQ
What does the parser identify?
- The browser and its version, the rendering engine, the operating system and the device type, along with whether the string belongs to a known bot or crawler. Paste any User-Agent, or press the button to inspect your own.
Why does every browser claim to be Mozilla?
- A compatibility legacy from the 1990s. Sites served better content to Netscape, so other browsers began identifying as Mozilla to receive it, and each subsequent browser inherited the convention. The token is now meaningless and simply appears in every string.
Can I trust the User-Agent?
- Not as a statement of fact. It is set by the client and can be changed to anything, which browsers offer as a built-in feature and which bots do routinely. Treat it as a claim that is usually true and occasionally deliberately false.
Should I use it to detect browser features?
- No. Test for the feature itself, which is accurate, future-proof and immune to spoofing. Parsing the User-Agent to infer capability is how sites end up broken in browsers that support everything they need but do not match an expected pattern.
Which AI crawlers does it recognise?
- GPTBot, ChatGPT-User and OAI-SearchBot from OpenAI; ClaudeBot and its variants from Anthropic; PerplexityBot; Google-Extended; CCBot from Common Crawl; Bytespider; Amazonbot; and Applebot-Extended. These are the ones that appear in server logs most often at present.
How do I block an AI crawler?
- Add a disallow rule for its token in robots.txt. Well-behaved crawlers, including the major AI ones, honour it. A crawler that ignores robots.txt needs blocking at the server or CDN level by User-Agent or by address range, though both are straightforward to evade.
What are Client Hints?
- A replacement mechanism where the browser sends detail such as platform and version only when the server asks for it. They exist because the User-Agent string is a strong fingerprinting signal. The practical effect is that the string carries progressively less information, and precise detection increasingly requires Client Hints.
Why is my browser version wrong or missing?
- Because browsers have frozen or reduced parts of the string deliberately. Chrome in particular reports a much less specific version than it once did. This is intentional privacy work rather than a parsing failure, and it will continue.
Can I tell mobile from desktop reliably?
- Approximately. The Mobile token is a reasonable signal and tablets are genuinely ambiguous, with iPads long reporting as desktop by default. For layout, use CSS media queries and feature detection rather than the User-Agent; for analytics, the approximate answer is fine.
Is the User-Agent string sent to a server?
- No. Parsing happens in your browser and the string is never transmitted, stored or logged.
// How to Use User-Agent Parser
-
Paste a User-Agent, or use your own
Paste a string from your server logs, or press the button to fill in your own browser's User-Agent and see how it parses.
-
Read the breakdown
The browser, engine, operating system and device are shown separately, along with a bot identification when the string belongs to a known crawler.
-
Use it for the right purpose
Logging, analytics and bot identification are good uses. Deciding what your code can do is not: feature-detect instead, since the string can be changed and increasingly omits detail.
Category Network