User Agents

Web browsers and everyday web tech, explained

Change User Agent Safari: How To & Why

· 4 min read · How the Web Works

In this article
  1. What Is a User Agent?
  2. Why Would You Want to Change It?
  3. How to Enable the Develop Menu
  4. Step-by-Step: Change the User Agent
  5. How to Choose the Right User Agent
  6. Common Problems and Solutions
  7. Alternatives to Changing the User Agent
  8. Safety and Limitations
  9. Frequently Asked Questions

To change the user agent in Safari, you use the Develop menu, which is hidden by default. This lets you spoof your browser as another device or browser, useful for testing responsive designs or accessing sites that block your current browser.

What Is a User Agent?

A user agent (UA) is a string of text that your browser sends to every website you visit. It identifies the browser name, version, operating system, and sometimes the device type. For example, a typical Safari UA string looks like:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15

Websites use this string to deliver the correct version of their page—mobile pages for phones, desktop layouts for computers, or specific CSS for certain browsers. Changing it makes the site think you are using a different browser or device.

Why Would You Want to Change It?

  • Web development: Test how a site looks on iPhone, Android, or older Safari versions without having those devices.
  • Access blocked content: Some sites (like certain streaming services or government portals) only work with specific browsers. Spoofing can bypass that.
  • View the desktop version: On an iPad, some sites force the mobile layout. Changing the UA to a Mac makes them show the full desktop site.
  • Debugging: If a site behaves differently in Safari vs. Chrome, you can temporarily make Safari appear as Chrome to isolate the issue.

How to Enable the Develop Menu

Before you can change the user agent, you must turn on the hidden Develop menu. Here’s how:

  1. Open Safari.
  2. Click Safari in the menu bar (top left).
  3. Select Settings (or Preferences on older macOS).
  4. Go to the Advanced tab.
  5. Check the box at the bottom: "Show features for web developers".

You’ll now see a Develop menu appear in the menu bar.

Step-by-Step: Change the User Agent

  1. Click the Develop menu in the menu bar.
  2. Hover over User Agent.
  3. Choose one of the preset options: Safari (current version), Safari iOS (iPhone/iPad), Chrome, Firefox, Microsoft Edge, or Googlebot.
  4. If you need a custom string, select Other… and paste any user agent string you want.

The change applies immediately to the current tab. To revert, choose Default (Automatically Choose) from the same menu.

How to Choose the Right User Agent

Pick the UA that matches the browser/device you want to simulate. For testing responsive design, choose the mobile Safari option. For bypassing a browser block, choose the UA of a browser that is allowed. If you need a specific version (e.g., Safari 15 on macOS 11), you must use the Other… option and paste a valid UA string from a reliable source.

Common Problems and Solutions

  • Develop menu missing: Make sure you enabled it in Settings > Advanced. If it’s still not there, restart Safari.
  • Change doesn’t stick: The UA resets when you close the tab or restart Safari. That’s normal—it’s a temporary override.
  • Site still detects your real browser: Some sites use JavaScript or other techniques beyond the UA string. A UA change won’t fool those.
  • Can’t find the Develop menu on iPhone/iPad: iOS Safari does not have a built-in UA switcher. You need a third-party app or a shortcut that injects a custom UA.

Alternatives to Changing the User Agent

If you need to test on multiple devices, consider using Safari’s Responsive Design Mode (Develop > Enter Responsive Design Mode). It simulates screen sizes and device pixel ratios without changing the UA. For more advanced testing, browser developer tools in Chrome or Firefox offer device emulation with UA spoofing built in.

Safety and Limitations

Changing your user agent is generally safe and does not expose you to security risks. However, some sites may behave unexpectedly or deny service if they detect a mismatch. Also, be aware that some services (like banking or streaming) may have terms that prohibit circumventing browser restrictions. Use this feature responsibly and only on sites you have permission to test.

Frequently Asked Questions

Does changing the user agent in Safari affect all tabs?

No, the change applies only to the current tab. Other tabs keep their original UA. If you want to apply it to a new tab, you need to change it again after opening a new tab.

Can I set a custom user agent permanently?

Safari does not offer a permanent global UA override. You can use the Other… option each time, or use a third-party extension that injects a custom UA on every page load.

Will changing the user agent make me anonymous?

No. The user agent is just one of many signals websites use to identify you. Your IP address, cookies, and browser fingerprinting still reveal your real device and location.

Why does the user agent string start with "Mozilla" even in Safari?

That’s a historical legacy. Early browsers used the string to indicate compatibility. Modern browsers keep it to avoid breaking sites that check for it.

Is it legal to change my user agent?

Yes, it’s legal. It’s a standard feature built into Safari for developers. However, using it to bypass paywalls or access restricted content may violate a site’s terms of service.

What is the best user agent for testing on an iPhone?

Use the preset Safari iOS option. It simulates the iPhone’s Safari browser, including the correct screen size and touch events.