# User agent

Also called: User-Agent, user agent string, UA string

A user agent is the string a browser, app or bot sends in the User-Agent header of every HTTP request to say what software it is, its version and often the operating system. Analytics tools read it to report browsers and devices and to recognise bots.

## How it is calculated

The header is free text with a loose convention, described on [MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent). A desktop Chrome request sends something like `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36`. A parser matches known patterns in it to name the browser, the operating system and the device type. Crawlers add their own token, such as `Googlebot` or `GPTBot`, usually with a link to their documentation.

The string is getting less detailed. Chrome has [reduced the user agent](https://www.chromium.org/updates/ua-reduction/) to fixed values for the operating system version and the minor browser version, and moved the detail to separate client hints a site has to ask for. Because the string is sent by the client, anyone can fake it.

## Example

A visit sends `Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1 Mobile/15E148 Safari/604.1`. The parser reads Safari on iOS, device type mobile. A second request sends `Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.4; +https://openai.com/gptbot` and is recognised as OpenAI's crawler, not a visitor.

## Common mistakes

- Trusting a bot's user agent as proof. Anyone can send `Googlebot`. Operators that publish IP ranges or reverse DNS let you verify the claim.
- Reading exact operating system versions from Chrome. After the reduction, Windows and Android versions in the string are often frozen values.
- Storing raw user agents as a harmless field. Combined with an IP address, the string helps identify a person, so privacy laws can treat it as personal data.

## How CrispStats shows it

CrispStats reads the user agent at the edge to work out the browser, operating system and device type, to filter bots and to compute the daily visitor hash, then discards it. Raw user agents are never stored. AI crawler hits that your site reports are matched by user agent to name the bot, its operator and purpose.

## Related terms

- [Bot traffic](/glossary/bot-traffic)
- [Web crawler](/glossary/web-crawler)
- [AI crawler](/glossary/ai-crawler)
- [Visitor hash](/glossary/visitor-hash)
- [Cookieless tracking](/glossary/cookieless-tracking)
