Web developers, quality assurance testers, and power users often need to verify how websites behave across different operating systems, browsers, and mobile hardware. Rather than switching between multiple physical devices or installing various third-party browsers, Apple Safari on macOS includes a native tool that allows you to change your browser’s User Agent string instantly.
A User Agent is a text string sent in HTTP request headers that identifies your browser name, engine version, and operating system to web servers. By altering this string in Safari, you can spoof your browser identity to appear as Google Chrome, Microsoft Edge, Mozilla Firefox, or mobile devices such as iPhone and iPad. This enables you to test responsive mobile layouts, access browser-restricted websites, and diagnose device-specific redirection rules. In this guide, you will learn how to enable Safari’s hidden Develop menu, switch user agents, and create custom user agent strings.
Why Change Your User Agent in Safari?
Spoofing your browser’s identity provides several practical advantages for web testing and daily browsing:
- Debugging Device-Specific Content: Test whether responsive websites properly serve mobile-optimised media, condensed navigation headers, or touch-friendly controls without needing a physical phone.
- Bypassing Browser Restrictions: Access web services or legacy corporate portals that artificially block Safari or require Chrome, Edge, or Firefox.
- Diagnosing Server-Side Redirects: Verify whether a server correctly detects user agent headers to route mobile users to dedicated mobile subdomains (e.g.,
m.example.com). - Testing Search Engine Crawlers: Emulate bot crawlers (such as Googlebot) to check server-rendered content and SEO pre-rendering configurations.
Step 1: Enable the Develop Menu in Safari Preferences
By default, Safari conceals its advanced developer tools. You must enable the Develop menu before you can modify the User Agent:
- Launch Safari on your Mac.
- Click Safari in the top macOS menu bar and select Settings (or press Cmd + ,).
- In the settings window, click the Advanced tab.
- At the bottom of the Advanced pane, check the box labelled Show features for web developers (on earlier macOS versions, this is labelled Show Develop menu in menu bar).
- Close the Settings window.
A new Develop item will now appear in your Mac’s top menu bar between Bookmarks and Window.
Step 2: Change Your User Agent to a Predefined Profile
Safari includes pre-configured User Agent strings for modern Apple and third-party browsers:
- Navigate to the webpage you wish to test in Safari.
- Click the Develop menu in the menu bar.
- Hover over User Agent. A submenu appears listing built-in browser profiles.
- Choose your desired browser or device profile:
- Safari — iOS (iPhone / iPad): Simulates mobile Safari on iOS or iPadOS, prompting websites to render mobile layouts.
- Google Chrome — macOS / Windows: Sends Chrome’s Blink engine headers on macOS or Windows.
- Microsoft Edge — macOS / Windows: Identifies your browser as Chromium-based Edge.
- Mozilla Firefox — macOS / Windows: Emulates the Gecko rendering engine.
Safari instantly reloads the current tab using the selected User Agent string. Any device-specific stylesheet or JavaScript script will now evaluate your browser according to the spoofed profile.
Step 3: Specify a Custom User Agent String
If you need to test a niche browser version, simulate an Android device, or emulate an automated web crawler, you can input a completely custom User Agent string:
- In Safari, click Develop > User Agent.
- Select Other… at the bottom of the submenu.
- A text input dialogue box will appear displaying your current User Agent string.
- Paste or type your desired string. For example, to emulate a modern Googlebot crawler:
Or to simulate an Android Chrome browser:Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36 - Click OK.
The active webpage will immediately refresh and receive your customised headers.
Step 4: Revert to the Default Safari User Agent
User Agent changes in Safari are applied on a per-tab basis and do not permanently modify your global browser profile. However, once your testing session is finished, it is best practice to revert back to default behaviour:
- Click Develop > User Agent.
- Select Default (Automatically Chosen) at the very top of the list.
Closing the tab or quitting Safari will also automatically reset the User Agent to default on newly opened tabs.
Tips for Accurate Mobile Emulation in Safari
While changing the User Agent modifies the request headers, it does not alter your physical screen dimensions. For comprehensive mobile web testing, combine User Agent spoofing with Responsive Design Mode:
- Press Ctrl + Cmd + R or click Develop > Enter Responsive Design Mode.
- Select specific device screen presets (e.g., iPhone 15 Pro, iPad Air) to simultaneously test touch event emulation, viewport scaling, and user agent strings.