Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

To view source code in Safari on a Mac, first enable the Develop menu from Safari > Settings > Advanced, then choose Develop > Show Page Source or press Option + Command + U. You can also right-click the page and select Show Page Source. On iPhone and iPad, Safari has no built-in viewer, so you use a bookmarklet, a third-party app, or remote inspection from a Mac.
Safari hides its developer tools by default, so the first step is turning on the Develop menu:
Once the Develop menu is enabled, you have three quick ways to see a page's HTML:
The HTML source opens inside the Web Inspector pane, where you can browse the markup, search it, and jump between resources.
Safari on iOS does not include a native source viewer, but you have a few workarounds:
javascript:(function(){window.location='view-source:'+location.href})()Viewing source code in Safari is simple once the Develop menu is enabled: use Develop > Show Page Source or the Option + Command + U shortcut on Mac, and rely on bookmarklets, apps, or remote inspection on iOS. For anything beyond static HTML, Web Inspector gives you the full live DOM, CSS, and JavaScript, and cloud device platforms let you inspect Safari on hardware you do not physically own.
Enable the Develop menu from Safari > Settings > Advanced by checking Show Develop menu in menu bar. Then choose Develop > Show Page Source, or press Option + Command + U. You can also right-click the page and select Show Page Source.
The shortcut is Option + Command + U. Once the Develop menu is enabled, pressing this combination opens the HTML source of the current page in the Web Inspector, making it the fastest way to view source frequently.
By default the Develop menu is hidden. Turn it on in Safari > Settings (or Preferences) > Advanced by ticking Show Develop menu in menu bar. In newer Safari versions the option may appear under a Developer or Advanced section.
iOS Safari has no built-in source viewer. Use a third-party App Store app like View Source, add a view-source bookmarklet, or connect the device to a Mac and inspect it remotely with Safari's Web Inspector over USB.
Show Page Source displays the raw HTML the browser received. Web Inspector is the full developer tool: it shows the live DOM, CSS, JavaScript, network requests, and console, letting you edit and debug the rendered page rather than just read static markup.
With the Develop menu enabled, right-click the element on the page and choose Inspect Element. Safari opens Web Inspector focused on that node, showing its HTML, applied CSS, and box model so you can debug layout and styling issues.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.

TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance