Safari can show the HTML source of any page, but unlike Chrome it hides the feature behind a developer setting you have to turn on first. Here’s how to do it on macOS, plus what to do on iPhone and iPad where Safari has no View Source at all.
Step 1: Enable the Develop menu (Mac)
By default there’s no View Source option in Safari. Turn on the developer features once:
- Open Safari → Settings (or press
Cmd+,). - Go to the Advanced tab.
- Tick Show features for web developers (on older Safari versions this reads Show Develop menu in menu bar).
A new Develop menu now appears in Safari’s menu bar.
Step 2: Show the page source
With the Develop menu enabled, you have three ways to view source:
| Method | How |
|---|---|
| Keyboard shortcut | Cmd + Option + U |
| Menu | Develop → Show Page Source |
| Right-click | Right-click the page → Show Page Source |
Safari opens its Web Inspector at the Sources tab (or Page Source view), showing the document’s HTML. It’s part of the full inspector, so you also get the DOM tree, network requests, and console alongside the raw markup.
Viewing the original source vs the live DOM
Safari’s Web Inspector shows the rendered DOM by default — the page after JavaScript has run. If you want the exact bytes the server sent (the true “view source”), the cleanest option is an online viewer: paste the URL into ViewSource.net and you’ll see the original HTML response with nothing added or modified. This is also the difference explained in View Source vs Inspect Element.
Safari on iPhone and iPad
Mobile Safari has no built-in View Source and no Develop menu. Three approaches work:
- Use ViewSource.net (easiest). Paste the page URL into ViewSource.net in mobile Safari. It fetches the raw HTML server-side and shows it with syntax highlighting, copy, and download — no computer needed. Full walkthrough in our view source on mobile guide.
- Add it to your Home Screen. Open ViewSource.net, tap Share → Add to Home Screen, and launch it like an app to paste URLs instantly.
- Connect to a Mac. Enable Settings → Safari → Advanced → Web Inspector on the iPhone, connect over USB, and on the Mac open Develop → [your iPhone] → [the page] to inspect it in the desktop Web Inspector. This is the most powerful option but needs a cable and a Mac.
Troubleshooting
- No Develop menu after enabling it. Quit and reopen Safari, and make sure you ticked the box in the Advanced settings tab.
- Show Page Source is missing on right-click. The Develop menu isn’t enabled yet — do Step 1.
- You only see a small amount of HTML. The site is client-side rendered; the server shell is minimal and the content is built by JavaScript. See why some pages won’t load.
Frequently asked questions
What is the view source shortcut in Safari? Cmd+Option+U, after enabling the Develop menu.
How do I view source in Safari on iPhone? Paste the URL into ViewSource.net, or connect to a Mac and use Web Inspector over USB.
Why is there no Show Page Source option? The developer features are off by default — enable them in Safari → Settings → Advanced.
Skip the setup entirely: paste any URL into ViewSource.net to read its source in Safari on Mac, iPhone, or iPad.