Viewing a site’s source code is an excellent way for beginners to learn HTML.

View Source Code in Chrome

So how do you view the source code of a website?

Here are the step-by-step instructions to do so using the Google Chrome web app.

View Page Source in contextual menu for Chrome web browser

Hilary Allison / Lifewire

Navigate to theweb page you would like to examine.

Right-clickthe pageand look at the menu that appears.

From that menu, clickView page source.

Developer tools menu item in Google Chrome

The source code for that page will now appear as a new tab in the internet tool.

On a Mac, this shortcut isCommand+Option+U.

To use Chrome’s developer tools:

OpenGoogle Chrome.

Navigate tothe web page you would like to examine.

Select thethree-dot menuin the upper-right corner of the web client window.

From the menu, hover overMore toolsand then chooseDeveloper toolsin the menu that appears.

It is super helpful if you want to learn more about a particular piece of a site.

Yes, seeing a site’s source code is legal.

Using that code as a resource to build something similar is also safe.

Taking code as-is and passing it off as your work is where you start to encounter problems.

Additionally, many websites today will include script files included along with the HTML.

Frankly, a site’s source code can seem overwhelming, especially if you are new to doing this.

Don’t get frustrated if you might’t figure out what’s going on with that site immediately.

Viewing the HTML source is just the first step in this process.

FAQ

Open Developer Tools in Chrome by pressingCtrl(orCommandon a Mac)+ Shift + I.

Move the text cursor to the far leftin front of the URLand typeview-source, then pressEnteror selectGo.