How to View a Website’s Source Code
Every browser can show the HTML, CSS and JavaScript a page sends to you. Here is how to read it, what it can tell you, and where its limits are.
When you open a web page, your browser downloads files and builds the page from them. Those files are public, so you are allowed to read them. This is how developers learn, debug and review sites they own or are authorized to test.
Three quick ways to view source
- View page source: press
Ctrl+U(Cmd+Option+Uon Mac) or typeview-source:before the address. You see the HTML exactly as the server sent it. - DevTools Elements panel: press
F12. This shows the live DOM after JavaScript has changed the page, which is often different from the original HTML. - DevTools Sources and Network panels: list every CSS, JavaScript, image and font file the page requested, with sizes and response codes.
What you will not see
Server-side code (PHP, Python, Node.js), databases, private environment variables and admin panels never reach the browser. If a page seems to hide something, it is usually because that logic runs on the server.
Why view-source is not always enough
Modern sites load content with JavaScript after the first response, so view-source can look nearly empty. The page also links to many separate files, and opening them one by one is slow.
Using CodBy for the full picture
Enter an authorized public URL in CodBy and it collects the HTML, CSS, JavaScript and assets in one workspace. You can search across all files, review findings, and export the project. For a deeper look at what gets listed, read the resource discovery guide.
Use it responsibly
Reading public files is normal. Copying a site’s code, bypassing access controls or testing a site you do not own without permission is not. Follow each site’s terms and local law.
Open CodBy Analyzer