Guide
Open an HTML file on iPhone
Someone sent you an .html file and your iPhone shows code, a blank page or a download button. That is normal: an iPhone has no browser for files saved on the phone. The fix that always works is a link.
By the ShareHTML team. Updated .
Try this first
- Tap the file in Mail, Messages or WhatsApp. iOS opens it in Quick Look, its preview.
- If you see only code or a download button, tap the share icon, choose Save to Files, then tap the file in the Files app.
- If you see the page, you are done. Quick Look shows some pages and the code of others.
Games, quizzes, calculators and charts need JavaScript, which usually does not run in Quick Look. They look right but do nothing when you tap them.
What always works: open it from a link
Safari opens web pages, not files saved on the phone. So put the file on the web:
- Ask the sender for a link instead of the file. If they made the page, they can drop it on sharehtml.org and send you the address.
- Or do it yourself in Safari: sign in at sharehtml.org with your email and the 6-digit code we send, then upload the file from Files.
- Open the link. The page runs in Safari like any website, scripts and all.
A free account holds 25 pages of up to 5 MB. Opening a link needs no account.
Why the iPhone shows code
An HTML file is instructions for a browser. Quick Look is a viewer, not a browser, so it either draws a simple version of the page or shows the text of the file. Safari has no button for opening a file saved on the phone. A web address is something Safari understands, so a link opens the same file as a page.
On iPad
The same applies: Files and Quick Look for a preview, a link for the real page.
If you are sending it to someone with an iPhone
Send a link, not the file. Upload it to ShareHTML and paste the link into Messages, WhatsApp or email: it opens in one tap. More in how to send an HTML file.
Questions
- Why does my HTML file open as text on iPhone?
- Quick Look decided the file is text. Open it from a link instead.
- Can Safari open an HTML file saved on my iPhone?
- Not directly. Safari opens web addresses: upload the file and open its link.
- Why does the page look right but the buttons do nothing?
- Quick Look usually does not run JavaScript. From a link, it runs.
- Is it safe to open an HTML file someone sent me?
- Treat it like any attachment from that person. A page can show a fake sign-in form, so never type a password into a page you did not expect.
On Android? See opening an HTML file on Android.