Open an HTML file on iPhone or Android

To open an HTML file on your phone, save it to Files (or Downloads on Android), then choose it below. The page opens right here in your browser, scripts and all — no app to install, and the file stays on your phone unless you choose Get a free link.

On an iPhone or iPad

  1. Open the email or message with the file, tap the attachment, then tap the share button and choose Save to Files.
  2. Come back to this page in Safari and tap Choose an HTML file. Pick the file from the Files browser that opens.
  3. The page renders straight away. Tap Full screen to read it without anything around it.

On an Android phone

  1. Tap the download icon on the attachment so the file is saved to your Downloads folder.
  2. Open this page in Chrome and tap Choose an HTML file, then pick it from Downloads.
  3. It opens as a page. Full screen hides everything else.

On a laptop there’s a fuller tool: the HTML viewer also shows the code, lets you edit it, and checks the page at phone, tablet and desktop widths.

Why phones make this hard

A phone treats an attachment as a document to preview, not a web page to run. Depending on the app, an HTML file may appear as a screen of code, as a page with its styling or scripts missing, or with no way to open it at all — and the browser, which could display it perfectly, has no obvious way to be handed a file from inside an email. Choosing the file on a web page is the gap-filler: the browser reads the file you give it and renders it like any other page.

If the page opens but looks broken — no pictures, no layout — the file was probably relying on other files that stayed on the sender’s computer. No viewer can show those. Ask for a link instead.

If you’re the one sending it, send a link

Everyone you email an HTML file to will hit this page’s problem on their phone. A link opens as a page for all of them, and when you correct something, the same link shows the new version. For a public page, a free host is enough — here are the options, including a free link from the box above that lasts 4 hours. For a report or a draft that shouldn’t be public, pagegoat puts it behind a password, an email check or a list of named people, from $2.99 a month.

Opening HTML files on a phone

Why does my iPhone show code instead of the page?

Because the app you opened it in is showing the file rather than running it. Mail, Messages and other apps preview attachments with a quick viewer built for documents, and depending on the app and the file that viewer may show the raw HTML, show the page with its styling or scripts missing, or offer no way to open it at all. Safari will display a web page happily, but there is no simple way to hand it a file sitting in an attachment. Saving the attachment to Files and opening it on this page gets round all of that: the file is rendered by Safari itself, with its scripts running, full screen.

How do I open an HTML file on an Android phone?

Download the file first, so it is saved in your Downloads folder rather than only inside the email or chat it came in. Then open this page in Chrome, tap Choose an HTML file, and pick it from Downloads. It renders straight away, scripts and all, and Full screen hides everything around it. Opening the file directly often goes wrong on Android in the same ways it does on an iPhone — the system may show the code, ask which app to use and offer none that renders it, or refuse to let the browser read it. Going through a web page sidesteps all of that, because the browser only has to display something you handed to it.

Is the file uploaded when I open it here?

No. Choosing the file lets this page read it inside your phone's browser, and it is rendered there; nothing is sent to pagegoat or anywhere else, and nothing is kept after you close the tab. That matters more than usual on a phone, because the files people struggle to open are typically ones somebody sent them — a report, an invoice, a page from a colleague — and it is reasonable not to want those passing through a stranger's server. The only way the file ever leaves your phone from here is if you tap Get a free link, which puts it online as a short-lived public link, or choose the paid upload, which asks you to sign in first.

Why is the page missing its pictures or layout?

Because they were never in the file. Many HTML pages refer to images, stylesheets and scripts stored alongside them in a folder, by paths like images/chart.png, and when a single .html file is sent on its own those companions stay behind on the sender's computer. No viewer can show what it does not have. Anything written inside the HTML itself, or loaded from a full web address, will appear. If a page arrives broken like this, the most useful thing to do is ask the sender for a link instead of the file, or for the whole folder as a ZIP — a host can serve the complete page, with everything it refers to, at one address.

Can I open an HTML file from an email attachment?

Yes, with one extra step: save it somewhere your browser can reach first. On an iPhone, tap the attachment, then the share button, and choose Save to Files. On Android, tap the download icon on the attachment so it lands in Downloads. Then come back to this page, tap Choose an HTML file, and pick it. If your email app only offers to preview the attachment and has no way to save it, open the same message in your mail provider's website in the phone's browser, which will usually let you download it. The file never needs to go anywhere other than your own phone.

I'm the one sending the file. How do I stop this happening?

Send a link instead of an attachment. A link opens as a page on every phone and computer, in whatever browser the reader already uses, and when you correct something the same link shows the new version — an attachment cannot do either. Free hosts such as GitHub Pages, Netlify and Cloudflare Pages work well for pages anyone may see. Pagegoat is built for the ones that should not be public: put the page behind a password, limit it to the people you name, or ask each reader for their email, and let them leave comments pinned to the text. To send one quickly, open it above and choose Get a free link: no account, and the link expires on its own. Links that last start at $2.99 a month.