What is a user agent?
A user agent is the software that makes web requests for you: a browser, an app or a script. The user agent string is the text it sends in the User-Agent header to describe itself, such as its name, version and operating system.
| Part | What it says |
|---|---|
| Mozilla/5.0 | A leftover from the 1990s that every browser still sends so that old sites keep working. |
| (Windows NT 10.0; Win64; x64) | The operating system and processor type. |
| AppleWebKit/537.36 (KHTML, like Gecko) | The rendering engine, with more names kept for compatibility. |
| Chrome/126.0.0.0 | The browser and its version. |
| Safari/537.36 | Another compatibility token. Chrome and Edge send it too. |
Because of all these compatibility tokens, a user agent names several browsers at once. The real one is usually the last specific name: Edg for Edge, OPR for Opera, Chrome for Chrome, and Safari only when none of the others appear.
What websites do with your user agent
- Send the mobile or the desktop layout.
- Offer the right download for your operating system.
- Warn you when your browser is too old for the site.
- Count which browsers visitors use.
- Tell browsers from scripts and automated clients, usually together with other signals.
User-Agent Client Hints
Chrome, Edge and other Chromium browsers now send a shortened user agent: the minor version is always 0.0.0, Windows 10 and 11 both read "Windows NT 10.0" and macOS always reads 10_15_7. The detail moved to separate headers called client hints.
Three hints go with every request: Sec-CH-UA (browser brands and major versions), Sec-CH-UA-Mobile and Sec-CH-UA-Platform. A site can ask for more, such as the full version, the device model or the processor type. Firefox and Safari do not send client hints.
Your user agent when you use a proxy
A proxy changes the IP address a website gets. It does not change the user agent or any other header: on HTTPS sites the proxy only passes encrypted data along and cannot read or edit it.
For data collection and testing, send a complete, current set of headers. A user agent that says Chrome should come with Chrome's client hints and an Accept-Language header, and a request without them looks unfinished. Many public sites also ask automated clients to name themselves in the user agent, so check the rules of the sites you work with.
How to set the user agent in your tools
Scripts send their library's default user agent, such as curl/8.5.0 or python-requests/2.32, unless you set one. Every HTTP client has an option for it:
curl -A "MyCrawler/1.0 (+https://example.com/bot)" https://example.com
import requests
headers = {"User-Agent": "MyCrawler/1.0 (+https://example.com/bot)"}
r = requests.get("https://example.com", headers=headers)const res = await fetch("https://example.com", {
headers: { "User-Agent": "MyCrawler/1.0 (+https://example.com/bot)" },
});const context = await browser.newContext({
userAgent: "MyCrawler/1.0 (+https://example.com/bot)",
}); What else your browser tells websites
The table at the top of this page also lists details that are not in the user agent. Any site can read them with JavaScript or from the request headers:
- Languages, in your order of preference.
- The time zone of your device, which can differ from the time zone of your IP address.
- Screen size, window size and pixel density.
- The number of processor cores and whether the screen takes touch input.
- Whether cookies are on, and the Do Not Track and Global Privacy Control settings.
See your IP address and its time zone →Test what WebRTC shows →
