PDF download Download Article PDF download Download Article

This wikiHow teaches you how to locate and copy the HTML source code of a website on your computer, phone, or tablet. The steps are pretty straight-forward when you're using a computer or an Android, but if you're using an iPhone or iPad, you'll need a third-party app like View Source to get the job done.

Things You Should Know

  • On a computer, right click a blank area of the website and choose View page source . Highlight all the text and hit Ctrl + C (PC) or ⌘ Cmd + C (Mac) to copy.
  • On Android, add view-source: to the beginning of the website URL. Tap and hold to highlight a word. Drag the bars to encompass all of the code. Tap Copy .
  • On Mac, install the View Source app. Copy and paste your website URL into the app and select go . Tap and hold any word to highlight it. Drag the bars to highlight more code and hit Copy .
Method 1
Method 1 of 3:

Using a Computer

PDF download Download Article
  1. You can use any web browser on your PC or Mac to view and copy a website's source code.
  2. If you're using Safari on a Mac, you'll need to enable the Develop menu if you want to view a website's source code. [1] This is only required on Safari, so you can skip this if you're using any other browser:
    • Click the Safari menu at the top of the screen.
    • Click Preferences on the menu.
    • Click Advanced .
    • Select Show Develop menu in menu bar .
    Advertisement
  3. A context menu will expand.
  4. The phrasing may vary slightly on different web browsers, but this option will always display the current page's source code. [2]
    • If you right-clicked in a frame, you'll see View Frame Source instead. [3] This will only display the source code of the current frame.
    • If you see a link to a file with a name like style.css near the top of the source code, this is a separate file that contains the styles (fonts, colors, layout info) for the website. [4] Click the link to open that page. If you want to copy all of the code for the site, you'll also need to copy this page.
  5. This highlights all of the code on the page. [5]
  6. Now the selected source code is pasted to your clipboard. [6]
    • To paste it into the desired location, right-click and select Paste .
  7. Advertisement
Method 2
Method 2 of 3:

Using an Android

PDF download Download Article
  1. You can use Google Chrome to view the source code of a website on your Android. [7]
  2. Wait for the site to load fully before you continue.
  3. This displays the address of the website.
  4. to the beginning of the URL. To do this, just move the cursor to the beginning of the URL (before the https://) and type view-source: .
    • For example, if you were going to view the source of wikiHow.com, the URL would look like this: view-source: https://www.wikihow.com
  5. This refreshes the site and displays only its source code.
    • If you see a link to a file with a name like style.css near the top of the source code, this is a separate file that contains the styles settings (colors, fonts, design, etc.) for the website. Tap the link to open that page. If you want to copy all of the code for the site, you'll also need to copy this page.
  6. This highlights that word and surrounds it by bounding handles.
  7. To do this, drag the leftmost bounding handle all the way to the beginning of the page, and the rightmost handle all the way to the end. A small toolbar will appear once you're finished.
  8. Now that you've copied the source code, you can paste it anywhere, such as into Google Docs or your note-taking app.
    • To paste the code into a file or app, tap and hold the typing area and select Paste .
  9. Advertisement
Method 3
Method 3 of 3:

Using an iPhone or iPad

PDF download Download Article
  1. You can still use your regular browser to load the website you want to view.
  2. Once you're on the page you want to view, tap the address bar at the top of the screen to select the URL. Then, tap it again to bring open the context menu and select Copy .
  3. It's the purple icon with a black window, two brackets, and a semicolon. You'll find it on your home screen and/or your app library.
  4. This pastes the copied URL into the address bar in View Source.
  5. This displays the source code for the URL you entered.
  6. This highlights that word and surrounds it by bounding handles.
  7. To do this, drag the leftmost bounding handle all the way to the beginning of the page, and the rightmost handle all the way to the end. A small toolbar will appear once you're finished.
  8. If it doesn't pop up on its own, tap and hold the highlighted area so it appears, and then select Copy . Once the source code is copied to the clipboard, you can paste it into any app you want, such as the Notes app or an email message.
    • To paste, tap and hold a typing area and select Paste . [8]
  9. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Video

      <form action="/contact" method="post"> <label for="name">Name:</label> <input type="text" id="name" name="name" required> <label for="email">Email:</label> <input type="email" id="email" name="email" required> <label for="message">Message:</label> <textarea id="message" name="message" rows="4" required></textarea> <input type="submit" value="Send">

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!

      About This Article

      Article Summary X

      1. Go to the website in a web browser.
      2. If you're using Safari on a Mac, enable the Develop menu.
      3. Right-click a blank area of the page.
      4. Click View page source .
      5. Highlight everything on the page.
      6. Right-click the selection and click Copy .

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

      Is this article up to date?

      Advertisement