How to change your user agent
Every major browser can send a different user agent, without extensions. Here is how, per browser, plus what changing it does and does not achieve.
Google Chrome
Per-tab, for the current session:
- Open DevTools — F12, or Ctrl+Shift+I (⌘+⌥+I on Mac).
- Press Ctrl+Shift+M to toggle the device toolbar, then pick a device from the dropdown. Chrome sends that device's user agent and emulates its viewport.
- For an arbitrary string: open the three-dot menu in DevTools → More tools → Network conditions, uncheck Use browser default, and enter it.
Browser-wide, from the command line:
chrome --user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 18_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Mobile/15E148 Safari/604.1"
Mozilla Firefox
Permanently, via configuration:
- Navigate to
about:configand accept the warning. - Search for
general.useragent.override. If it does not exist, select String and click + to create it. - Set the value to the string you want. It applies immediately, to every tab.
- To revert, delete the preference using the bin icon — clearing it to an empty string is not the same thing.
Per-session: open the Responsive Design Mode with Ctrl+Shift+M and choose a device preset.
Safari
- Open Settings → Advanced and tick Show features for web developers.
- The Develop menu appears in the menu bar.
- Choose Develop → User Agent and pick a preset, or Other to type your own.
The change applies to the frontmost tab and resets when it is closed.
Microsoft Edge
- Open DevTools with F12.
- Press Ctrl+Shift+M for device emulation, or open Network conditions from the DevTools menu.
- Uncheck Use browser default and enter your string.
From the command line
# cURL
curl -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" https://example.com
# Wget
wget --user-agent="Googlebot/2.1 (+http://www.google.com/bot.html)" https://example.com
# Python requests
requests.get(url, headers={"User-Agent": "AcmeBot/1.0 (+https://acme.example/bot)"})
What changing it does not do
On Chromium browsers there is a further wrinkle: overriding the string does not automatically update the Client Hints headers, which continue reporting your real platform. Chrome's Network conditions panel keeps them in sync; a command-line flag or a naive extension usually does not, so a site reading hints sees straight through the override.
Frequently asked questions
Is changing your user agent legal?
Yes. It is a client-controlled header, browsers ship the feature deliberately, and web developers use it daily. Using it to circumvent access controls or terms of service is a separate question governed by those terms, not by the header itself.
Will it stop websites from tracking me?
No. Tracking overwhelmingly relies on cookies, IP addresses and fingerprinting signals that are unaffected by the string. Changing it in isolation can make you easier to single out, because the mismatch between what you claim and what your browser demonstrably is becomes its own signal.
Why does the site still detect my real browser?
Two likely reasons. Either it is using feature detection — checking for APIs only your real browser has — or it is reading Client Hints, which your override did not change. Chromium sends Sec-CH-UA headers independently of the user agent string.
Which user agent should I use for testing?
A real one, current for the device you are emulating. Pick from the database — invented strings often fail validation on sites that check structure, and outdated ones can trigger unrelated legacy code paths that confuse your results.