Download Article 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.

Method 1 of 3:
Using a Computer

  1. 1
    Go to the website you want to copy. You can use any web browser on your PC or Mac to view and copy a website's source code.
  2. 2
    Enable the Develop menu (if you're using Safari). 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.
  3. 3
    Right-click a blank area of the website. A context menu will expand.
  4. 4
    Click View page source on the menu. The phrasing may vary slightly on different web browsers, but this option will always display the current page's source code.
    • If you right-clicked in a frame, you'll see View Frame Source instead.[2] 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.[3] 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. 5
    Press Ctrl+A (PC) or Cmd+A (Mac). This highlights all of the code on the page.
  6. 6
    Press Ctrl+C (PC) or Cmd+C (Mac). Now the selected source code is pasted to your clipboard.
    • To paste it into the desired location, right-click and select Paste.
    Advertisement

Method 2 of 3:
Using an Android

  1. 1
    Open Chrome or Samsung Internet on your phone or tablet. You can use Google Chrome to view the source code of a website on your Android.[4]
  2. 2
    Go to the website you want to view. Wait for the site to load fully before you continue.
  3. 3
    Tap the address bar. This displays the address of the website.
  4. 4
    Add view-source: 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. 5
    Tap the search, enter, or go key to go to the site. 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. 6
    Tap and hold any word in the source code. This highlights that word and surrounds it by bounding handles.
  7. 7
    Drag the bounding handles to select all of the source code. 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. 8
    Tap Copy on the toolbar. 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.
    Advertisement

Method 3 of 3:
Using an iPhone or iPad

  1. 1
  2. 2
    Open Safari (or your preferred web browser). You can still use your regular browser to load the website you want to view.
  3. 3
    Copy the URL. 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.
  4. 4
    Open the View Source app. 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.
  5. 5
    Tap the address bar and select Paste. This pastes the copied URL into the address bar in View Source.
  6. 6
    Tap the go key on the keyboard. This displays the source code for the URL you entered.
  7. 7
    Tap and hold any word in the source code. This highlights that word and surrounds it by bounding handles.
  8. 8
    Drag the bounding handles to select all of the source code. 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.
  9. 9
    Tap Copy on the menu. 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.
    Advertisement

Community Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit

      Advertisement

      About This Article

      Nicole Levine, MFA
      Co-authored by:
      Tech Specialist
      This article was co-authored by Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 1,314 times.
      How helpful is this?
      Co-authors: 4
      Updated: March 25, 2021
      Views: 1,314
      Categories: HTML
      Article SummaryX

      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 1,314 times.

      Is this article up to date?

      Advertisement