Is there a way to view the source HTML in an Android web browser?


14 Answers 14


You can use Javascript's alert method to return the source code, type this in the address bar:

javascript: alert(document.getElementsByTagName('html')[0].innerHTML);

  • 3
    initially, I had doubt that javascript: URI scheme would work on Android's browser, but it seemed to work on my 2.1 browser. However, you don't get syntax highlighting and you cannot copy the text, so it's not very usable for long HTML pages.
    – Lie Ryan
    Commented Jan 22, 2011 at 1:45
  • 1
    Doesn't work for me! The emulator always adds the http:// prefix and I get a site not found by Google.
    – user2771
    Commented Feb 7, 2011 at 17:13
  • 1
    Chrome for Android only shows around 50 or so lines.
    – user49212
    Commented May 18, 2015 at 19:07
  • Doesn't work on Firefox for Android. Commented Dec 23, 2017 at 1:14

In Firefox or Chrome on Android it's possible to view source by prefixing the URL in the address bar with "view-source:", i.e. "view-source:http://google.com".

  • 4
    Great solution. It even generates syntax coloring (at least on Chrome) and allows to copy source code to the clipboard.
    – Jpsy
    Commented Oct 15, 2013 at 7:50
  • 2
    For Firefox for Android there is an add-on which lets you view source code without prefixing URLs each time, just click the "View Source" entry from the app menu and you'll see source code for currently open webpage. The add-on is View Source Mobile Commented Dec 23, 2013 at 6:40
  • 7
    As a bookmarklet: javascript:document.location='view-source:'+document.location; Commented Jan 30, 2015 at 5:22
  • 1
    This also works on Firefox and Chrome on Linux and Windows, probably on macOS
    – Motte001
    Commented Jun 30, 2016 at 10:41
  • 1
    This does not work for modified pages, because it gets the source from the server, not the browser. So if you have for example JavaScript that has modified an element, you will not get the updated HTML, but the old/updated HTML from the server.
    – Chiwda
    Commented Jan 15, 2017 at 15:05

Look for an app called View Web Source in the market and install it.

Then when browsing, open your menu and tap "share", in the list that pops up choose View Web Source.


The app mentioned in this answer hasn't been updated since 2009.

You might want to try VT View Source.

  • 1
    This has syntax highlighting and is very easy to use. Works with the default Android browser and Chrome. Latest Firefox for Android has it's own View Source, so it does not need this.
    – Ezward
    Commented Dec 20, 2014 at 20:24

Another tool that is useful for viewing source AND modifying them live, in Firebug/Web Inspector-like manner, is the weinre remote debugger.


Create a new bookmark (bookmarklet) on Mobile Chrome with:

Name: View Source (vs)

URL: javascript:document.location='view-source:'+document.location; void(0);

Now when on a page, tap the address field and start typing: vs. The bookmarklet should appear, click it and you are ready.


IN chrome, there is remote debugging facility. If you install Chrone on your phone. If you connect your phone through usb to PC,you can view the Javascript modified source on your PC in a Chrome browser.

See the end of http://eclipsesource.com/blogs/2012/08/14/debugging-javascript-on-android-and-ios/


If this is for debugging (from your comment it looks like it is) something even better is installing a user agent switcher extension for Firefox or Chrome on your desktop. Change the user agent to Android and you get the mobile version of the site, but with all the source and debugging tools you're used to.


you can capture the source to your shell or to a text file if you're using an emulator, which is very handy for development. To do this you'll need to install Android Developer Tools, which comes with adb. Fire up your emulator then from your OS's shell run the command:

adb logcat browser:V *:S

This will output anything from the browser app on your emulator and suppress any other log messages. From there any javascript console.log commands will be captured by adb and output for you to view. So, if you're using JQuery, you can add this to your page and it'll output the whole page html to the log:


This will output everything within your html tag on the page to the log.

You can capture the output of your log (using BASH, at least, I can't speak to other shells) with:

adb logcat browser:V *:S > log.txt

now, any output from the log gets dumped into your log.txt file. This is really handy for a whole page's worth of HTML, as you can then search through it as you would any other text doc.

If you want to grab a specific bit of the page rather than the whole thing, you can specify that part of the page rather than the html tag in your JQuery, so if you need to look at a single div that has a class/id associated with it (for this example, it has a class named 'inspect-me'), you can change your JQuery to:

  • 1
    While this may work fine, the question said in the Android web browser -- not from. Getting the source using a PC has much easier ways -- as e.g. pressing Ctrl-U in Firefox ;)
    – Izzy
    Commented Aug 25, 2012 at 17:15

If you are using a Opera browser type this in your address bar, make sure you erase the http and other stuff, then type:


in the address of the page which you opened.


That feature seems to be unavailable for all major android browsers. You could try Opera Mini instead.

  1. Reset the console output by opening a new tab with the address debug:resetconsole

    Reset output

  2. Open a tab on the page on which you want to do the inspection:


  3. Run JavaScript code on the page by replacing the address in the address bar with the following address javascript:var%20n%3Ddocument.firstChild%3Bwhile%28n%20%26%26%20n.nodeType%21%3DNode.ELEMENT_NODE%29%20n%3Dn.nextSibling%3Bconsole.log%28n.outerHTML%29%3B

  4. Retrieve the output by opening a new tab with the address debug:console



Kiwi Browser as of January 2022 offers "Developer tools" feature through which one can access rendered HTML among other things. See screenshot to know where to find it. The developer tools for a given webpage are loaded in a new tab.

Since Kiwi Browser also allows installing Chrome for PC extensions you can find an extension that allows viewing HTML of a webpage and can install it in Kiwi Browser. It should also work.

enter image description here


In firefox, if it is a real link to the final page (not the link we click on google), you can press and hold over the link and click on "download link", then open it in a text viewer (i suggest xplore app).

Bonus answer: to download a .mp3, from that downloaded page's text, select the .mp3 url, share it with "open with" or "better open with" app, and open it in the "NoBrowser" app that can handle .mp3 download, and is fast and tiny!


If you want to view source of Android browser page, or inspect page you can use this https://developer.chrome.com/devtools/docs/remote-debugging Its very good inspector

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .