How do I view the source code of a web page?

All Internetbrowsers allow users to view the HTML or other source code of any of the web pages they visit. For example, a user can view the code used to generate this page by following the examples below. Below is a listing of some of the different major browsers and how to view the source code in each of those browsers.

Note: When viewing the source code of a web page it is important that you keep in mind that only information and code that is not processed by the server does not appear in the source code. For example, almost all Internet search engines process information on the server and then display the results on a web page. This means you can view the code used to generate the results page but you cannot view the search engine's source code.

This rule applies to all server side scripts, SSI, and code. Therefore, features such as search engines, forums, polls, chat, etc. will not display their code, and copying the information from the source code causes errors or direct you back to page you copied the information from.

Tip: See our HTML definition for a basic overview of HTML code as well as links to other places to learn HTML, CSS, and other code you'll see when viewing the source.

Microsoft Internet Explorer users

To view the source code of a web page in Microsoft Internet Explorer, follow the steps below.

Once the above steps have been completed a new window with the source code will be shown.

Tip: With the latest versions of Internet Explorer press the F12 key to get the DOM tool and a much more interactive way of view the source code and CSS files. This feature also allows you to make changes in the source and see how those changes affect the site immediately.

Mozilla Firefox and Netscape users

To view the source code of a web page in Mozilla Firefox or Netscape, follow the steps below.

Google Chrome users

Click on the "wrench" or "Menu" icon in the top-right side of the browser window.

From the drop-down-menu click "Tools" and then "View Source"

Once the above steps have been completed a new window with the source code will be shown.

Tip: Press the F12 key to get the inspection tool and a much more interactive way of view the source code and CSS files. This feature also allows you to make changes in the source and see how those changes affect the site immediately.

Opera users

To view the source code of a web page in Opera, follow the steps below.