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

View source codeAll Internet browsers 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.

Microsoft Internet Explorer users
Mozilla Firefox and Netscape users
Google Chrome users
Opera user

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 will be displayed 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 will likely only cause 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.

Internet ExplorerMicrosoft Internet Explorer users

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

  1. Press CTRL+U

or

  1. Open Internet Explorer
  2. Click View
  3. From the drop-down-menu click "Source"

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

FirefoxMozilla Firefox and Netscape users

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

  1. Press CTRL+U

or

  1. Open Mozilla Firefox or Netscape
  2. Click View
  3. From the drop-down-menu click "Page Source"

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

Tip: In Firefox you can highlight the portion of a web page you want to view the source code of and then right-click that highlighted section and click View Selection Source.

Tip: Use the Firebug add-on to not only view the source code of a page but change and view those changes live through the browser.

ChromeGoogle Chrome users

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

  1. Press CTRL+U

or

  1. Open Mozilla Firefox or Netscape
  2. Click View
  3. From the drop-down-menu click "Page Source"

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

OperaOpera users

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

  1. Press CTRL+F3

or

  1. Open Opera
  2. Click View
  3. From the drop-down-menu click "Source"

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