How to view webpage HTML source codes on iPad / iPhone. No app required.

This article explains how you can view the source code (HTML, CSS, JavaScript etc) for any webpage on your iOS device (iPad, iPhone or iPod touch). No app required. Here is how:

Related: How to view HTML source code in Safari


1.Tap Safari (iPhone or iPad), if it is not already open, and visit this page.

2.Tap the Action button:

Safari Tap

3.Tap Bookmark:

safari bookmark

4.Tap the Name Field and hit the X icon to clear it and name it “Show Page Source” and then tap “Save”.

Show Page Source

5.Now visit this page and select all and copy the javascript code: (code credit: Rob Flaherty)

copy code

6.Tap the Bookmarks icon and tap Edit:

edit safari bookmarks

7.Tap the “Show Page Source” bookmark you just created in step # 4:

edit show page html css source bookmark

8.Tap the Address Field and hit the X icon to clear it, then paste the javascript code you copied in step # 5; then tap Done.

copy code bookmark

Done! Now you can to to any web page using mobile Safari on your iOS device (iPhone or iPad), tap the Bookmarks icon then tap the Show Page Source bookmark and a new window will open displaying the source code of the webpage.

show page source

see HTML code of a site


  1. HunterJones says

    Hey, thanks! Why the heck Apple took this out is beyond me. I swear… Apple, I love usually you but I HATE you sometimes.

  2. Umer says

    I followed all of the steps but when I go to see page source it opens a new tab which says:

    Any solutions?

Leave a Reply

Your email address will not be published. Required fields are marked *