{{HTTPSidebar}}
The User-Agent request header contains a characteristic string that allows the network protocol to identify the application type, operating system, software vendor or software version of the requesting software user agent.
Header type | {{Glossary("Request header")}} |
---|---|
{{Glossary("Forbidden header name")}} | no |
Syntax
User-Agent: <product> / <product-version> <comment> Common format for web browsers: User-Agent: Mozilla/<version> (<system-information>) <platform> (<platform-details>) <extensions>
Directives
- <product>
- A product identifier
- <product-version>
- A version number of the product.
- <comment>
- Zero or more comments containing sub product information, for example.
Firefox UA string
The UA string of Firefox itself is broken down into four components:
Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion
- Mozilla/5.0 is the general token that says the browser is Mozilla compatible, and is common to almost every browser today.
- platform describes the native platform the browser is running on (e.g. Windows, Mac, Linux or Android), and whether or not it's a mobile phone. Firefox OS phones simply say "Mobile"; the web is the platform. Note that platform can consist of multiple "; "-separated tokens. See below for further details and examples.
- rv:geckoversion indicates the release version of Gecko (such as "17.0"). In recent browsers, geckoversion is the same as firefoxversion.
- Gecko/geckotrail indicates that the browser is based on Gecko.
- On Desktop, geckotrail is the fixed string "20100101"
- Firefox/firefoxversion indicates the browser is Firefox, and provides the version (such as "17.0").
Examples
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0 Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0) Gecko/20100101 Firefox/42.0
Chrome UA string
TBD
Examples
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
Opera UA string
TBD
Examples
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36 OPR/38.0.2220.41
Safari UA string
TBD
Examples
Mozilla/5.0 (Linux; U; Android 4.0.3; de-ch; HTC Sensation Build/IML74K) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30
Specifications
Specification | Title |
---|---|
{{RFC("7231", "User-Agent", "5.5.3")}} | Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content |
Browser compatibility
The compatibility table in this page is generated from structured data. If you’d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data/README.md and send us a pull request.
{{Compat}}