How can you view a website page source?

Updated Written By Christoffer
How can you view a website page source?

Viewing page sources allows you to examine a website’s HTML code, which can be a handy way of investigating it in more detail.

This article lists the most common browsers and how to open a webpage source code.

Google Chrome

  1. Open the website you want to view the page source.
  2. Right-click on the page (not an image or link).
  3. Select “View Page Source” from the menu.
  4. The new tab shows the HTML source code.

Mozilla Firefox

  1. Open the website you want to view the source of.
  2. Right-click on the page.
  3. Select “View Page Source” from the context menu.
  4. A new tab will open, showing the page’s HTML source code.

Microsoft Edge

  1. Open the website you want to view the source of.
  2. Right-click on the page.
  3. Select “View Page Source” from the context menu.
  4. A new tab will open, displaying the page’s HTML source code.

Safari (Mac)

  1. Open the website you want to view the source of.
  2. Right-click on the page (or Control-click if you don’t have right-click enabled).
  3. Select “Show Page Source” from the context menu.
  4. The source code will appear at the bottom of the browser window.

Mobile browsers

Viewing the page source on mobile browsers can be a bit challenging, as mobile browsers don’t support viewing the page source by default.

If you’re on a mobile browser, we recommend using an online tool to extract the source code.

FAQ about page source

What is a website’s page source?

A website’s page source is the code that displays the content you see in your browser.

The page source consists of three main components:

  • HTML: HTML, which stands for HyperText Markup Language, is the basic structure of a webpage and includes headings, paragraphs, links, images, and more.
  • CSS: CSS, which stands for Cascading Style Sheets, is the webpage styling and design specifications. The CSS is responsible for all design elements.
  • JavaScript: JavaScript is responsible for all dynamic elements and interactivity on a page.

Can the source code tell us everything about a website?

We can get much information from the page source, but it doesn’t show everything.

Below is a list of things the page source doesn’t show us:

  • Server-side code: The page source does not show any code on the server (the backend), including code written in Node.js, PHP, or Python.
  • Databases: Databases store information but aren’t exposed to page sources.
  • Back-End frameworks: If the website uses Django, Rails, or Express, it isn’t shown in the source code.
  • Performance optimizations: The source code doesn’t expose CDNs and load balancing.

What is the difference between page source and source code?

In the context of a websites actual code, both page source and source code is used to describe the same thing.

Some browers call the source code for page source, which can be a bit confusing.

If we are extra precise, a page source is more accurate than source code. Source code is actually more appropriate term for all of the code that sits behind a website (backend, frontend, database interaction etc.).

Article by

Christoffer Pettersen

Founder, Web developer

Pettersen is the founder of Stackcrawler, a platform that helps analyze tech stacks. He is passionate about new trends and technologies in the software industry.