There are people out there who like to see what’s under the hood of web pages they visit. Whatever your reasons might be for that, there are a few simple steps that allow you to see the HTML source code of a website in Safari for Mac. In this post, we’ll show you how to view the source code of a web page.
How do you view HTML source code in Safari?
The first step to being able to see the HTML code of a site is to enable Develop mode, a mode that Apple hides by default as the company assumes only developers would want to tinker with these options.
Enable Develop mode in Safari
- Open Safari and press Command + comma (,) keys, or click Safari > Preferences from the top menu bar.
- Go to the Advanced tab.
- At the bottom, check the box that says Show Develop menu in menu bar.
In the menu bar, you will now see a new tab called Develop.
Show page source code
Now that you have enabled this developer mode, you can access the source code of a web page in three different ways:
- With the web page open, go to Develop in the menu bar and select Show Page Source.
- On the web page for which you want to see the source code, press the Option + Command + U keys simultaneously.
- This is probably the easiest option. Simply Control-click or right-click on an empty area of the page and select Show Page Source.
When performing any of these actions, the source code of the page will then appear at the bottom of your Safari window. From there, you can inspect all you want.