- View HTML code in Chrome
- How to View HTML Code of a Web Page in Chrome on Windows PC
- How to view the HTML code of a web page in Chrome on a Mac
- How to view the HTML code of a web page in Chrome on the iPhone app
- How to view the HTML code of a web page in Chrome in the Android app
- How to view the HTML code of a web page in Chrome on an iPad
Device links
Are you curious about what constitutes a web page? Do you want to know how to change the font size or color on your website? By viewing the HTML code of a web page, you can do all of these things and more.

In this tutorial, we will show you how to view the HTML code of a web page in Chrome.
View HTML code in Chrome
When writing in HTML, the source code is the series of tags and attributes that are used to define the structure and content of a web page.
Web browsers read the source code and translate it into the graphical web page you see on the screen. In addition to defining the appearance of a web page, source code can also be used to add interactivity, such as pop-ups, forms, and drop-down menus.
While the average Internet user may never need to view the HTML source code of a web page, there are several reasons why some might want to do so.
For developers, viewing the source code can be a useful way to understand how a page is structured and determine what style elements and scripts are used. For designers, it can be beneficial to see how other designers have used HTML to create effective designs.
In some cases, users may also want to view the source code to fix bugs or learn more about how a particular website or web application works. Whatever the reason, viewing the HTML source code is a relatively simple process in Chrome.
How to View HTML Code of a Web Page in Chrome on Windows PC
The Windows operating system is one of the most supported systems for Chrome. Chrome is based on the open source Chromium project, to which Microsoft is a major contributor. This support extends to the HTML realm, where the popular browser allows users to view the HTML code of any website.
You can view the HTML code in two ways.
Using View Page Source
This method is simple:
- Open Chrome and navigate to the page where you want to view the HTML source code.

- Right-click the page and select View Page Source, or press Ctrl + U on your keyboard to open the source code in a new tab.

The source code will appear in the new tab and you can scroll through it to see the HTML markup for that page.
Use of development tools
To inspect the source code of a web page using the developer tools in Google Chrome, follow the steps below.
- Open Google Chrome and navigate to the web page you want to inspect.

- Press Ctrl + Shift + I on your keyboard. The Developer Tools panel will open in a panel next to the web page you are viewing.

- Click the “Elements” tab at the top of the panel. This will display the HTML source code of the web page.

- You can now review the source code of the page. To collapse an item, click the triangle next to its tag name. To view more information about a component, right-click on it and select “Inspect.”

Note that this method is best for HTML pages; It is possible to view the source code of other types of web pages, but the formatting may be more difficult to read.
How to view the HTML code of a web page in Chrome on a Mac
If you are a web developer, it is important to be able to see the HTML code of a web page. This allows you to see how the page is structured and troubleshoot any issues that may arise. Fortunately, it’s easy to do in Chrome on a Mac. Just follow these steps:
- Open Chrome and navigate to the web page where you want to view the HTML code.

- Right click on the page and select “Inspect.”

- A new panel will open at the bottom of the screen displaying the HTML code.

- You can also click on specific elements of the HTML code to see how they are laid out on the page. For example, you can see what CSS styles are being applied to an element by selecting it and then clicking the “Styles” tab in the panel that opens.

- To close the panel, click the “X” in the upper right corner.

Alternatively, you can use Chrome Developer Tools to view the source code.
- Open Google Chrome and navigate to the web page you want to inspect.

- Click the menu icon (three dots) in the top right corner of the browser and select More Tools and Developer Tools from the drop-down menu.

- The Developer Tools panel will open at the bottom of the screen. Select the “Items” at the top of the panel.

- You will now see the HTML code of the current page displayed in the Elements panel. You can use the different panel options to inspect and debug the code as needed.

With just a few clicks, you can easily view the HTML code of any web page in Chrome on a Mac. This can come in handy when you’re trying to troubleshoot web development problems or want to take a closer look at how a particular website is built.
How to view the HTML code of a web page in Chrome on the iPhone app
If you’re using an iPhone, you can view the HTML of any page in Chrome in two ways:
Modifying the URL
You can easily view the HTML code of any page by making a small adjustment to the URL:
- Open Chrome and navigate to the web page whose HTML code you want to view.

- Tap once on the address bar to start editing mode.

- Move the cursor to the front of the URL.

- Type “View Source” and then press the “Go” button. The HTML code of the web page will be displayed in Chrome.

Use of development tools
Chrome Developer Tools is also available on iOS, but it requires a different set of steps to launch it compared to PCs.
- Tap the three dots in the top right corner of the screen and select “Settings.”
- Scroll down and tap “Advanced,” then turn on the option next to “Developer Tools.”
- Press and hold an empty area of the page, then select “Inspect Element.” This will open a side panel with the HTML code for that page.
How to view the HTML code of a web page in Chrome in the Android app
When using the Chrome app on your Android phone, you may want to view the HTML code of a web page. This can be useful if you are trying to troubleshoot a problem with the page or want to see how the page is structured. To view the HTML code of a web page in Chrome on your Android phone, follow these steps:
- Open Chrome on your Android.

- Type “view-source:” followed by the URL of the page where you want to view the source code. For example, if you wanted to view the source code for www.google.com, you would type “view-source:www.google.com” into Chrome’s address bar.

This will open the HTML code for that page in Chrome’s built-in developer tools interface. From there, you can view and edit the code as you wish. Please note that this method will only work if the website you are trying to view allows access to its source code. If not, you won’t be able to see anything other than an error message.
How to view the HTML code of a web page in Chrome on an iPad
Chrome on the iPad app makes it easy to view the HTML code of any web page. Simply follow these steps:
- Open Chrome and type “view-source:” followed by the URL of the page you want to view. For example, if you want to view the source code for www.alphr.com, you would type “view-source:www.alphr.com” in Chrome’s address bar.

- Press the “Go” button.

This should load the page source code in a new tab within Chrome. From there, you can save or share the code as needed.
Source code is the glue that holds pages together
HTML is the basis of any website. It provides the structure and content that visitors see when they load a page in their browser.
While the final appearance of a page may be determined by CSS or other styling languages, HTML code determines the basic structure and content of the page. Some changes can potentially break the page. For this reason, it is important to have a good understanding of HTML when viewing or making changes to the source code.
Also, note that while viewing the HTML code may be helpful in some cases, changes made to the code will not be reflected on the live web page. Only changes posted by the site administrator will be visible to visitors.
Have you tried to view the HTML code of any web page using any of the methods described in this tutorial? How did it go?