Change User Agent in Chrome, Edge, Firefox and Safari
To change user agent in Chrome or Edge, open DevTools, go to Network conditions, clear “Use browser default” and pick or paste a string. In Firefox, set general.useragent.override in about:config; in Safari, enable web developer features in Settings, Advanced, then use Develop, User Agent. A string isn’t enough: Client Hints and JavaScript values may still show your real device.
A site serves a mobile layout on your desktop, a bot-check page, or a different version of a page than you expected. To reproduce it, you change user agent and see what the server sees. QA engineers, SEO checkers and people who run separate identities in one browser all do this.
You’ll be able to change the string, confirm it worked, reset it, and judge when one header isn’t enough.
Key Takeaways
- Scope differs: DevTools affects one open tab, the Firefox preference is global until reset, and extensions persist.
- A Playwright context override doesn’t change Client Hints or other fingerprint signals by itself.
- A user agent that disagrees with platform, touch points, screen size, WebGL renderer, time zone or IP can be flagged.
- A fake user agent isn’t a legitimate way to evade a ban or access control.
What does changing your user agent actually change?
Changing your user agent changes one string, the User-Agent request header, while the Client Hints and JavaScript values that also describe your browser stay as they were.

MDN’s User-Agent reference describes the User-Agent request header as a string that lets servers identify the application, operating system, vendor or version of the requesting user agent. Your browser attaches it to every request, so a server sees it before any page code runs.
Chrome now sends a reduced string: in the examples on Chrome for Developers, only the major version is real, as in Chrome/98.0.0.0. The finer detail moved to User-Agent Client Hints.
MDN’s User-Agent Client Hints API page lists two routes:
- Sec-CH-UA request headers: the browser sends them, and a server can ask for more detail.
navigator.userAgentData: a JavaScript property that page scripts read directly.
Older properties such as navigator.platform are a third, separate source.
This is why values can disagree. Paste an iPhone string into DevTools and the User-Agent header says iPhone, but navigator.userAgentData and the Sec-CH-UA-Platform header can still say Windows. A site that compares them sees a mismatch, and that comparison is part of browser fingerprinting.
Why change your user agent, and what is off limits?
You change your user agent to see how a site treats different clients, never to dodge a ban or an access control.
Legitimate reasons
- QA across layouts. Geekflare’s guide notes that a website can change its design elements and resolution based on the user agent, so you can check a mobile layout from your desktop.
- Responsive and device testing. As Search Engine Journal puts it, developers need to see how sites behave in different browsers and devices. A changed string is a quick first pass, not a replacement for a real device.
- Checking what a server sends each client. Load the page with a desktop string, then a phone string, and compare the responses.
- SEO cloaking checks. Copy Googlebot’s current user agent strings exactly as Google Search Central’s crawler documentation lists them, not an older pattern from a blog post. Google’s verification page covers the other side: “You can verify if a web crawler accessing your server really is a Google crawler, such as Googlebot.”
A changed UA only shows what a server sends to that string. It doesn’t make you Googlebot, and a cloaking check is for comparing page versions.
Off limits
These steps are not for evading a ban or bypassing an access control with a fake UA.
Spoofing also carries risk. WhatIsMyTools warns that a UA that disagrees with your Client Hints and the JavaScript platform value can be flagged, because modern sites cross-check the header against “a dozen other signals.”
How do you change the user agent in Chrome, Edge, Firefox and Safari?
Each browser changes the user agent in a different place and for a different length of time. Verify every change, because the request header and the values JavaScript reads can disagree.
Chrome
Chrome changes the user agent for the current tab only, and only while DevTools stays open. Chrome’s DevTools documentation puts the setting in the Network conditions panel.
- Press
F12(orCmd+Option+Ion macOS) to open DevTools. - Open the ⋮ menu, then More tools, then Network conditions.
- Under User agent, clear Use browser default.
- Pick a preset, or paste your string into the custom field.
- Keep DevTools open and reload the page.
Verify. Open the Network panel, click the first (document) request, and read User-Agent under Request Headers. Then run this in the Console:
navigator.userAgent;
navigator.platform;
navigator.userAgentData; // brands, mobile, platform
navigator.userAgentData?.getHighEntropyValues(["platformVersion"]);
If userAgent shows your string but userAgentData still names the real browser, a page can see through the change.
Reset. Tick Use browser default again, or close DevTools.
Edge
Edge works like Chrome, as Microsoft’s DevTools documentation shows: the setting is in the Network conditions tool.
- Press
F12to open DevTools. - Open the Customize and control DevTools menu (⋯), then More tools, then Network conditions.
- Under User agent, clear Use browser default and pick or paste a string.
- Reload with DevTools still open.
Verify. Read User-Agent on the document request in the Network tab, then run the same console checks as in Chrome.
Reset. Tick Use browser default, or close DevTools.
Firefox
Firefox has no built-in switcher, so you set a preference, and it applies to every tab until you remove it.
- Open a new tab, type
about:configand accept the warning. - Search for
general.useragent.override. - If it doesn’t exist, type the name, choose String, and click the + button.
- Paste your full user agent as the value and save it.
- Reload the page you’re testing.
Verify. Open DevTools (F12), go to Network, reload, click the document request and read User-Agent. In the Console, check navigator.userAgent and navigator.platform.
A typo in the value raises no error, so always confirm the header after saving.
Reset. Find the preference again and click the delete icon beside it. Because the override is global, forgetting this step changes every site you open.
Safari
Safari changes the user agent for the current tab through the Develop menu, which Settings hides until you turn it on.
- Choose Safari, then Settings (not Preferences), then Advanced.
- Tick Show features for web developers.
- Open the Develop menu, then User Agent.
- Pick a listed browser, or choose Other and type a string.
- Reload the page.
Verify. Choose Develop, then Show Web Inspector, open Network, reload and read the User-Agent request header. Then check navigator.userAgent and navigator.platform in the Console.
Reset. Choose Develop, then User Agent, then Default.
A changed header is only one signal. Run our browser fingerprint check to see whether the header, the Client Hints and the JavaScript values agree.
Which way to change user agent fits your task?
The right way to change user agent depends on how long the change must last and whether one string is enough.
| Method | Scope and persistence | What it changes | How to verify |
|---|---|---|---|
| Chrome or Edge DevTools | Current tab, only while DevTools is open | UA string | Network panel, then console |
Firefox about:config | Global until you reset it | UA string | Network panel, then console |
| Safari Develop menu | Current tab | UA string | Network panel, then console |
| Browser extension | Persistent, switches across tabs | UA string | Network panel, then console |
| Automation library | Per context or page in the script | UA string, not the rest of the fingerprint | Log request headers in the script |
| Per-profile fingerprint | Set per profile | UA with platform, time zone and WebGL | Fingerprint test page |
The first four rows change one string, and a script override has the same limit. Check both the request header and what the page reads in JavaScript, including Client Hints.
| Your task | Use | Why |
|---|---|---|
| One-off testing | DevTools | Nothing to install, nothing to undo |
| Persistent switching | Extension | Stays on as you move between tabs |
| Scripted tests | Automation library | Set in code, per context |
| Separate identities | Per-profile fingerprint | The UA agrees with the rest of the device |
One changed header does not isolate accounts, because cookies, IP and fingerprint still link them.
If you run separate identities for clients, brands or regions, the last row is the one that fits. Our guide to what an anti-detect browser is explains how per-profile fingerprints and cookie stores work. For testing and scripts, the first rows are enough.
How do you set the user agent in Playwright, Puppeteer and Selenium?
You set the user agent in Playwright on the browser context, in Puppeteer on the page, and in Selenium through a Chrome option. Each call changes the header, but none of them rewrites everything a site can read.
Playwright (JavaScript): pass userAgent when you create the context.
const context = await browser.newContext({ userAgent: '<your UA string>' });
const page = await context.newPage();
Puppeteer: call page.setUserAgent before you navigate.
await page.setUserAgent('<your UA string>');
await page.goto('https://example.com');
Selenium with Chrome (Python): pass the --user-agent switch through Chrome options.
options = webdriver.ChromeOptions()
options.add_argument("--user-agent=<your UA string>")
driver = webdriver.Chrome(options=options)
How do you verify the change?
Run both checks for every method. Skipping the second is the usual mistake.
- Read the request header. In a headed run, open DevTools, go to the Network panel, click the document request and find
User-Agentunder Request Headers. In a headless run, logrequest.headers()from apage.on('request')handler in Playwright. - Read what the page sees. Run this in the page’s console, or through your library’s evaluate call:
console.log(navigator.userAgent, navigator.platform, navigator.userAgentData);
Success means navigator.userAgent and the header both show your string. Then compare the rest.
Set a macOS string in a Playwright context on a Linux machine, and the header and navigator.userAgent say macOS. But navigator.platform can still say Linux, and navigator.userAgentData can still list the real browser brands.
A context-level override doesn’t by itself change Client Hints or other fingerprint signals such as WebGL or time zone. If a site compares those values, set them explicitly or use a tool that sets them together. For scripted runs at scale, see our browser automation use case.
What else must match a changed user agent?
A changed user agent only holds up when the other values your browser reports tell the same story, because detection systems compare them. WhatIsMyTools says “flipping that one header rarely makes you anonymous, because modern sites cross-check it against a dozen other signals.”
Signals to align with the new user agent
- Platform:
navigator.platformshould match the operating system in the string. MDN documents bothnavigator.platformandnavigator.maxTouchPoints. - Touch points: a phone string should come with
maxTouchPointsabove 0. - Screen size: the screen should fit the device the string names.
- WebGL renderer: the GPU string should fit the claimed device, not name an Apple GPU under a Windows string.
- Time zone and language: both should fit the claimed region.
- IP location: the IP should sit where the time zone says you are.
Three mismatches are easy to produce: a Windows string with a Mac value in navigator.platform, an iPhone string with no touch points and a desktop screen, and a New York IP with an Asia/Ho_Chi_Minh time zone. Our guide to matching proxies with time zone and language covers the last one.
Paste a Windows string into a Mac browser, and one console line exposes the contradiction:
[navigator.userAgent, navigator.platform]
The first value says Windows. The second returns a Mac value such as MacIntel. Any script on the page can run the same line, and that mismatch is what a check can flag.
Self-check
- Open the Network panel and read the
User-Agentrequest header. - In the console, run
navigator.userAgentDataand read its brands and platform (the Client Hints). - Open Donut Browser’s free browser fingerprint tool and compare its platform, screen, WebGL and time zone values.
- Run the free bot detection tool and look for flagged contradictions.
If the header, the Client Hints and the JavaScript values disagree, fix the mismatch before you rely on the change.
Where Donut Browser fits
Donut Browser sets the user agent for each profile inside its browser engine, as one piece of a full device fingerprint, instead of patching a single header.
Each profile runs on Wayfern, a Chromium fork. Wayfern sets the user agent, platform, timezone, language, WebGL, canvas, audio and WebRTC values at the C++ level, not with scripts injected into the page. The pricing page lists full fingerprint protection on the free plan, at the same quality as paid plans.
The limits are plain:
- Other operating systems: fingerprints for other operating systems need the Pro plan.
- Automation: the Browser Manipulation API, which launches a profile so Playwright or Puppeteer can attach over CDP, is on Pro at $99/month.
- Scope: Donut Browser does not sell proxies, is not a VPN or Tor, and does not guarantee against bans.
If you only need a one-off string for testing, DevTools or an extension is enough. If you need a coherent identity per profile, that is what Donut is built for.
The app is open source under AGPL-3.0 for macOS, Windows and Linux, and the source code is on GitHub, so you can check how it works.
Frequently asked questions
How do I change my user agent?
To change your user agent, open Chrome or Edge DevTools, go to Network conditions, clear Use browser default, and pick or paste a user agent. In Firefox, set general.useragent.override in about:config. In Safari, turn on developer features in Settings, then use Develop, User Agent. Verify in the Network panel.
Why does a site still see my real device?
Your user agent is only one of several signals a site reads. Client Hints headers, navigator.platform, the WebGL renderer, your time zone and your IP can still show the real device. Compare them with the header.
How do I reset my user agent to default?
Undo the setting where you made it. In Chrome or Edge, tick Use browser default or close DevTools. In Firefox, delete general.useragent.override in about:config. In Safari, pick Default under Develop, User Agent.
Does changing my user agent make me anonymous?
No, changing it hides very little. Your IP address, cookies and browser fingerprint stay the same, so sites can still link your visits. Accounts that must stay apart need a full fingerprint per profile, as our browser fingerprinting guide explains.
Is it OK to change my user agent?
Yes, for testing layouts, QA and SEO cloaking checks. Don’t use a fake user agent to evade a ban or get past an access control.
Change your user agent, then check that it holds
Today: switch the string in DevTools under Network conditions, then compare the User-Agent request header with navigator.userAgent and navigator.userAgentData in the console. If they disagree, the change didn’t fully hold.
This week: pick the method from the task table that matches the work you repeat, and run the fingerprint check after each change.
For separate identities: try a per-profile setup. Download Donut Browser, set up your first profile, and run the fingerprint check on it. It doesn’t guarantee against bans, but it keeps each profile’s signals consistent.
Sources
How to Change Your User Agent (and Why Websites Still Know… · User-Agent header - HTTP | MDN · How to Change User-Agent in Chrome, Firefox, Safari, and… · How to Change User-Agents in Chrome, Edge, Safari & Firefox · Verifying Googlebot and other Google crawlers | Google… · developer.mozilla.org · Pricing: Free Forever, Solo, Pro and Team — Donut Browser · donutbrowser/donutbrowser on GitHub