Skip to content
Start here

How to open an HTML file on Android or iPhone

Phones are not built to open loose .html files. Here is what works on Android and iPhone, why scripts and images often fail, and the one-minute way to make the page open with a tap.

6 min readUpdated October 2026By the HTMLtoLink team
Short answer

On Android, open the file from the Files app and choose Chrome; on iPhone, the Files app shows a basic preview. Both struggle with pages that use separate CSS, JavaScript or image files. The most reliable way is to upload the file to HTMLtoLink from your phone's browser — you get a link that opens the full page, scripts and all, with one tap.

Android

  1. Open the Files app (or My Files on Samsung) and find the .html file, usually in Downloads.
  2. Tap it. If asked, choose Chrome (or another browser).
  3. If it opens as text or nothing happens, long-press the file → Open with → Chrome.

Limitations: the page loads from a local content:// address, so links to neighbouring files (style.css, img/photo.jpg) frequently fail, and some JavaScript features that require a real web origin — modules, fetch() of local files, service workers — do not run.

iPhone and iPad

  1. Save the attachment to the Files app (Share → Save to Files).
  2. Tap the file to get a Quick Look preview — fine for simple text and images.
  3. For anything interactive, Quick Look is not a browser; scripts and linked files often do not work and there is no reliable "open in Safari" for local files.
  1. On your phone, open htmltolink.dev in Chrome or Safari.
  2. Tap Upload file, ZIP or folder, then pick the .html or .zip from Files / Downloads.
  3. Tap Get my link. Open it, or tap Share to send it.

Now the page runs on a real HTTPS origin, so CSS, JavaScript, images, fonts and even camera or geolocation APIs behave the way they do on any website. If you received the HTML from someone else, this is also the friendliest way to pass it on.

Online HTML Viewer
Edit HTML and see it render live — phone, tablet or desktop width
Open the free tool

Previewing HTML code on your phone

If you have HTML as text — copied from an email or an AI chat — paste it into the online HTML viewer to see it rendered, switch to the Phone width, and publish it from there.

Why does it look tiny on my phone?

The page is missing the viewport meta tag. Add this inside <head>:

<meta name="viewport" content="width=device-width, initial-scale=1">

Then check it in the responsive viewer.

Questions people ask

Which app opens HTML files on Android?

Any browser — Chrome, Samsung Internet, Firefox or Edge. Use the Files app's Open with option and pick one.

Why doesn't JavaScript work when I open the file on my phone?

Local files run with stricter rules than websites: ES modules, fetch() of other local files and some APIs are blocked. Publishing the page to a link gives it a real HTTPS origin, where they work.

Can I edit HTML on my phone?

Yes, in the online HTML viewer — edit, preview at phone width, then publish it as a link.

Read next

Your HTML deserves a real link

Paste code, drop a file, a ZIP or a whole folder — get a live URL with your own address, an optional password and a QR code. Free to start with Google sign-in; paid plans keep links online for good.

Turn HTML into a link