User-Agent rotation is the practice of cycling through a variety of realistic User-Agent strings across requests, rather than sending the same one repeatedly, to make automated traffic look more like a diverse population of real visitors.
It changes one request header, the one that names the browser, operating system and version. It doesn't change your IP address, your TLS handshake or the other HTTP headers a client sends, so it works only when those tell the same story.
How User-Agent Rotation Works
- Build a pool: collect current strings from real browsers, matched to the devices you want to look like.
- Pick one: choose a string per request, or keep one per session so a single visitor doesn't switch browsers between pages.
- Match the rest: send the other headers that browser sends, in the same form.
- Refresh the pool: browsers update often, and old version numbers stand out.
Why Default User-Agents Stand Out
Common HTTP tools announce themselves unless you change the header. curl sends curl/ plus its version, such as curl/7.54.1, and Scrapy's default is Scrapy/VERSION (+https://scrapy.org). Servers sometimes decide how to respond based on this header.
What a Modern Chrome User-Agent Looks Like
Chrome now sends a reduced User-Agent string. User-Agent reduction removes the exact OS version, the device model and the minor browser version. The major version stays, and the minor numbers are always 0.0.0.
- Before:
Mozilla/5.0 (Linux; Android 16; Pixel 9) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.12.45 Mobile Safari/537.36 - After:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Mobile Safari/537.36
The platform part is frozen too: Windows NT 10.0; Win64; x64 on Windows, Macintosh; Intel Mac OS X 10_15_7 on macOS, and Android 10; K on Android. Chrome began shipping the 0.0.0 minor version in Chrome 101, and the trial that let sites keep the full string ended in September 2023. A rotation list full of Chrome strings with real build numbers, or with an exact Android model, describes browsers that no longer exist.
Keeping Other Signals Consistent
- Client Hints: Chrome sends
Sec-CH-UA,Sec-CH-UA-MobileandSec-CH-UA-Platformby default on HTTPS pages. They repeat the brand, major version, platform and mobile flag, so they need to agree with the User-Agent. MDN notes these headers don't work in some widely used browsers, so a string that claims to be one of those shouldn't carry them. - Verifiable signals: OWASP lists Client Hints as a declared signal that can be checked against the TLS fingerprint.
- The TLS handshake: anti-bot systems can still use signals a User-Agent string doesn't change, such as the TLS fingerprint (JA3 or JA4), which identifies a client by how it starts a TLS connection.
Rotation Drops the Name robots.txt Matches
robots.txt rules are grouped by a crawler's product token, such as ExampleBot. RFC 9309 says that token should appear in the User-Agent the crawler sends, as in Mozilla/5.0 (compatible; ExampleBot/0.1; https://www.example.com/bot.html). A bot that rotates through browser strings drops that token, so the site can't tell which bot is visiting or check its traffic against the rules written for it. Rotating doesn't change which rules apply, either: the crawler's own token picks its group, or the user-agent: * group if none names it.
Sites also don't trust the header on its own. Google says Googlebot's user-agent is often spoofed and recommends checking a crawler's IP with a reverse DNS lookup or against published IP ranges instead.
What It Means for Web Scraping
- Use current strings: for Chrome, that means the reduced format with
0.0.0minor versions and frozen platform values. - Rotate whole profiles: change the User-Agent together with its Client Hints and other headers, and pair each profile with one IP for a session rather than mixing them.
- Decide how you identify: a crawler that should follow named robots.txt rules needs a stable product token in its User-Agent. Rotating it away doesn't change which rules apply to you.