How to Copy Code From a Website

View and copy code from any website using Chrome, Firefox, or Safari

What to Know

  • Chrome: Right-click a blank space on the page and choose View Page Source. Highlight the code, then copy and paste to a text file.
  • Firefox: From the menu bar, choose Tools > Web Developer > Page Source. Highlight the code, then copy and paste to a text file.
  • Safari: Select Show Develop in Advanced Settings. Choose Develop > Show Page Source. Copy and paste the code into a text file.

If you're a web user, designer, or developer who often comes across great looking websites with features you'd like to emulate, you can view or save the website code for your reference. In this guide, we show you how to copy website code using Chrome, Firefox, and Safari.

How to Copy Code in Google Chrome

  1. Open up Chrome and navigate to the web page that you want to copy.

  2. Right-click on a blank space or empty area on the web page. Just make sure you don't right click on a link, an image, or any other feature. 

  3. You'll know you'll have clicked in a blank space or empty area if you see an option labeled View Page Source in the menu that appears. Select View Page Source to show the web page's code.

  4. Copy the entire code by highlighting all or just the specific area of code that you want, pressing Ctrl+C or Command+C on your keyboard and then paste the code into a text or document file.

A website's source code.
 Evgenii_Bobrov / Getty Images

How to Copy Code in Mozilla Firefox

  1. Open up Firefox and navigate to the web page that you want to copy.

  2. From the top menu, select Tools > Web Developer > Page Source.

  3. A new tab will open with the page's code, which you can copy by highlighting a specific area or by right-clicking to Select All if you want all of the code. Press Ctrl+C or Command+C on your keyboard and paste it into a text or document file.

How to Copy Code in Apple Safari

  1. Open up Safari and navigate to the web page that you want to copy.

  2. Click on Safari in the top menu and then click Preferences.

  3. In the top menu of the box that pops up over your browser, click the Advanced gear icon.

  4. Make sure Show Develop menu in menu bar is checked off.

  5. Close the Preferences box and click the Develop option in the top menu.

  6. Click Show Page Source to bring up a tab with the code from the bottom of the page.

  7. Use your mouse to drag the tab up your screen if you'd like to bring it up to view it in full and copy it by highlighting all or just the specific area of code that you want, pressing Ctrl+C or Command+C on your keyboard and then Paste it wherever you want.

Format
mla apa chicago
Your Citation
Nations, Daniel. "How to Copy Code From a Website." ThoughtCo, Nov. 18, 2021, thoughtco.com/copy-code-from-website-3486220. Nations, Daniel. (2021, November 18). How to Copy Code From a Website. Retrieved from https://www.thoughtco.com/copy-code-from-website-3486220 Nations, Daniel. "How to Copy Code From a Website." ThoughtCo. https://www.thoughtco.com/copy-code-from-website-3486220 (accessed April 18, 2024).