How to View Source in a Desktop Browser

For all the major desktop browsers—Google Chrome, Microsoft Edge, Mozilla Firefox, Opera, Vivaldi—press Ctrl+U to open a new tab that displays the raw HTML of the page you’re on. On a Mac, press Cmd+Option+U or Cmd+U in Firefox. Alternatively, all desktop browsers support a URL-specific tweak. Prepend the text view-source: to the URL to open the page in Source mode. For example, type view-source:https://www.lifewire.com to view the source code behind Lifewire’s main landing page.

How to View Source on a Default Mobile Browser

The stock Android browser allows the view-source: URL tweak. On iOS, however, the stock Safari app does not support this feature. On Apple’s platform, you’ll need to launch a different browser or a source-code viewing app from the App Store. Individual mobile browsers that you installed from your platform’s app store behave differently. Consult the browser’s documentation for specific procedures.