PDF download Download Article
Learn how to view the code of a website in any browser
PDF download Download Article

This wikiHow guide teaches you how to view the source code of a website, which is the code behind any website (such as HTML, CSS, and JavaScript), on most common browsers, including mobile browsers. Keep reading to learn more.

View Page Source on Any Website

In Chrome, Firefox, and Edge, right-click the web page, then click View source (or Page source , View page source , etc.). In Safari, you'll have to enable developer tools to view source code. On mobile, go to view-page-source.com and enter a URL to see its source code.

Method 1
Method 1 of 4:

Chrome, Firefox, and Edge

PDF download Download Article
  1. The process for viewing source code on Chrome, Firefox, and Microsoft Edge is the same.
  2. Open the page containing the source code you wish to view.
    Advertisement
  3. If you're using a Mac computer with a one-button mouse, you can hold down Control and click instead. If you are on a laptop with a trackpad, you can use two fingers to click the page instead. This will create a drop-down menu.
    • Don't right-click a link or photo; it must be a blank part of the page. If you right-click an object or link, the wrong menu will appear.
  4. The button might also say Page source , View source , or something similar. The option is near the bottom of the contextual menu that pops up. Doing so will display your browser's source code in a new window or at the bottom of the current window.
    • You can also use the keyboard shortcut Ctrl + U (PC) or ⌥ Option + ⌘ Command + U (Mac) to see the source code of a web page.
  5. Advertisement
Method 2
Method 2 of 4:

Safari

PDF download Download Article
  1. It's on the top-left side of your Mac's menu bar. Doing so opens a drop-down menu. [1]
  2. 2
    Click the Settings menu and select the Advanced tab. This option has an icon of two cogwheels. [2]
  3. 3
    Check the "Show features for web developers" or "Show Develop menu in menu bar" box. You will see one of these options, depending on your version of macOS. Once enabled, you should see a Develop menu appear in your Mac's menu bar when Safari is open.
  4. It should be a page with the source code you wish to view.
  5. This menu is to the left of the Window menu in your Mac's menu bar. [3]
  6. It's near the bottom of the drop-down menu. Clicking this option will prompt Safari to display the webpage's source code. [4]
    • You can also press ⌥ Option + ⌘ Command + U to display the source code.
  7. Advertisement
Method 3
Method 3 of 4:

Mobile Browsers

PDF download Download Article
  1. 1
    Go to https://www.view-page-source.com . While there are some tricks that allow you to view source code in a mobile browser, the easiest and quickest way is to use a website called View Page Source. This site will pull the source code of any URL you give to it and then display that source code for you.
    • This will work on Android, iPhone, iPad, or any other mobile phone or tablet browser.
    • This website also works on your desktop, if you want to use it instead of the methods above.
  2. 2
    Enter the URL of the page where you want to view the source code. You can either manually type the URL, or paste it. If you haven't got the URL copied, go to the website and copy the URL now, then return to the View Page Source website and enter it in the URL field.
  3. 3
    Tap Stylize Code? if desired (optional). This will add colors to the source code that make it easier to read.
  4. 4
    Tap View Source Code . Scroll down to view the source code for the website.
    • If the source code is too hard to read, tap Toggle Wrap above the code block to turn on word wrap, so the lines of code won't extend past the edge of your screen.
  5. Advertisement
Method 4
Method 4 of 4:

On a Wiki Article

PDF download Download Article
  1. This could be any wiki, such as Wikipedia—or even wikiHow!
    • This will not show you the actual source code of the webpage, but the markup code used to create the article.
  2. Since wikis are sites that can be edited by anyone , any page or article you see on a wiki should have an Edit button. However, you may not see this option on all articles, or you may be required to log in to see it.
  3. Note that this slightly differs from the source code for a web page, since it only shows the content inside the article on that page. However, this is a good way to see how the special wiki-specific coding works within that article.
  4. Advertisement

Community Q&A

Search
Add New Question
  • Question
    The view source doesn't exist on my Mac, where do I find it?
    Community Answer
    To be able to view the source code of a webpage under Safari, you first need to enable the Developer menu: Click on Safari menu > Preferences > Advanced. Check "Show Develop menu in menu bar" Close the Preferences window Go to the Develop menu > Show Page Source
  • Question
    How do I view the source code of an image on a page without seeing the code for the whole page?
    Community Answer
    Right-click on the image and select "Inspect" from the available options.
  • Question
    How do I create HTML source code for an image that I have on my computer?
    Community Answer
    Add the image location on your computer to the source code. Make sure the file is available and then run.
See more answers
Ask a Question
      Advertisement

      Tips

      • While you can't usually view source code on a mobile browser, you can save a Safari bookmark on iPhone or iPad to view mobile Safari source code.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Be wary of downloading third-party applications that claim to display the source code of a website.
      Advertisement

      About This Article

      Article Summary X

      1. Open the website in a browser.
      2. Right-click the page.
      3. Click View page source or View source .

      Did this summary help you?
      Thanks to all authors for creating a page that has been read 1,026,395 times.

      Is this article up to date?

      Advertisement