View source on mobile

Read the code behind a web page or a file on your phone, with line numbers and colors for HTML, CSS, JavaScript, Python, JSON and more. Free, and nothing is uploaded.

Works with GitHub, Gist, code CDNs and other sites that allow it. For any other web page, use the bookmarklet.

View the source of the page you are on

Phone browsers have no "View source". This bookmarklet adds one: it reads the page you are on and opens its HTML here.

View source

  1. Desktop: drag the button above to your bookmarks bar.
  2. iPhone or Android: bookmark this page, then edit the bookmark: replace its address with the code below and name it "View source".
  3. On any page, open the bookmark (on a phone, type "View source" in the address bar and pick the bookmark). The source opens in a new tab.

The bookmarklet runs only when you tap it, reads only the page you are on, and sends the code straight to this tab in your browser. Nothing goes through a server.

How it works

  • URL: paste a link to a file. GitHub and Gist page links are turned into their raw file automatically.
  • Paste: drop in any code you copied.
  • File: open a file from your phone or computer.

The language is detected from the file name or the code, and you can pick it yourself. Wrap long lines, change the text size, switch to dark mode, format minified JSON or CSS, and copy the code. Your choices are remembered on this device.

Questions

How do I view the source code of a web page on my phone?

Phone browsers do not show page source. Add the View Source bookmarklet from this page to your bookmarks, open any web page, then open the bookmark. The page's HTML opens here with line numbers and syntax highlighting.

Why can't I just paste any URL?

For security, browsers only let a page read files from another site when that site allows it. GitHub, Gist and most code CDNs allow it, so their URLs work. For other sites, use the bookmarklet, open the file, or paste the code.

Which languages are highlighted?

HTML, CSS, JavaScript, TypeScript, JSON, Python, PHP, Markdown, shell scripts, YAML, SQL and XML. The language is detected from the file name or the code itself, and you can pick it by hand.

Is my code uploaded anywhere?

No. Everything runs in your browser. Pasted code and opened files never leave your device.

Is it free?

Yes. It is free, with no sign-up and no limits beyond a 5 MB file size.

Built by Roberto Iriondo. More free tools are on the tools page.