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
- Open the website you want to view the page source.
- Right-click on the page (not an image or link).
- Select “View Page Source” from the menu.
- The new tab shows the HTML source code.
Mozilla Firefox
- Open the website you want to view the source of.
- Right-click on the page.
- Select “View Page Source” from the context menu.
- A new tab will open, showing the page’s HTML source code.
Microsoft Edge
- Open the website you want to view the source of.
- Right-click on the page.
- Select “View Page Source” from the context menu.
- A new tab will open, displaying the page’s HTML source code.
Safari (Mac)
- Open the website you want to view the source of.
- Right-click on the page (or Control-click if you don’t have right-click enabled).
- Select “Show Page Source” from the context menu.
- 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.).
Christoffer Pettersen
Founder, Web developerPettersen is the founder of Stackcrawler, a platform that helps analyze tech stacks. He is passionate about new trends and technologies in the software industry.