How to Copy HTML Source Code on Your Computer, iPhone, or Android

Download ArticleDownload Article

This How.com.vn 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

Download Article
  1. How.com.vn English: Step 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. How.com.vn English: Step 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.
    Advertisement
  3. How.com.vn English: Step 3 Right-click a blank area of the website.
    A context menu will expand.
  4. How.com.vn English: Step 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.[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. How.com.vn English: Step 5 Press Ctrl+A (PC) or ⌘ Cmd+A (Mac).
    This highlights all of the code on the page.[5]
  6. How.com.vn English: Step 6 Press Ctrl+C (PC) or ⌘ Cmd+C (Mac).
    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

Download Article
  1. How.com.vn English: Step 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.[7]
  2. How.com.vn English: Step 2 Go to the website you want to view.
    Wait for the site to load fully before you continue.
  3. How.com.vn English: Step 3 Tap the address bar.
    This displays the address of the website.
  4. How.com.vn English: Step 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 How.com.vn.com, the URL would look like this: view-source:https://www.wikihow.com
  5. How.com.vn English: Step 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. How.com.vn English: Step 6 Tap and hold any word in the source code.
    This highlights that word and surrounds it by bounding handles.
  7. How.com.vn English: Step 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. How.com.vn English: Step 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.
  9. Advertisement
Method 3
Method 3 of 3:

Using an iPhone or iPad

Download Article
  1. How.com.vn English: Step 1 Install View Source from the App Store icon.
    There's no setting in any iPhone or iPad web browser that lets you view a website's source code easily. Fortunately, there's an app for that! View Source is a small, easy-to-use app that lets you view and copy the source code of any website.
  2. How.com.vn English: Step 2 Open Safari (or your preferred web browser).
    You can still use your regular browser to load the website you want to view.
  3. How.com.vn English: Step 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. How.com.vn English: Step 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. How.com.vn English: Step 5 Tap the address bar and select Paste.
    This pastes the copied URL into the address bar in View Source.
  6. How.com.vn English: Step 6 Tap the go key on the keyboard.
    This displays the source code for the URL you entered.
  7. How.com.vn English: Step 7 Tap and hold any word in the source code.
    This highlights that word and surrounds it by bounding handles.
  8. How.com.vn English: Step 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. How.com.vn English: Step 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.[8]
  10. Advertisement

Expert Q&A

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

      Video

      Tips

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

      About This Article

      How.com.vn English: Nicole Levine, MFA
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for How.com.vn. 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 63,909 times.
      How helpful is this?
      Co-authors: 6
      Updated: April 6, 2024
      Views: 63,909
      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 63,909 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement