TROUBLESHOOTING

How to open an HTML file on iPhone (and get it to work like a web page)

Someone sent you an .html file, or an AI tool made one, and on your iPhone it shows as a flat preview, raw code or a blank screen. What iOS does with the file, and the way to open it as a working page.

4 min read·

Tap an .html attachment in Mail, Messages or the Files app and iOS shows it in a preview. The text and some styling appear, but tabs do not switch, charts stay empty and buttons do nothing. Sometimes you see the markup instead. There is no "Open in Safari" option for a file stored on the phone.

Why the file does not behave like a web page

The preview in Mail and Files is a document viewer. It is built to show a file, not to run a web app, so pages that depend on JavaScript (most pages made by Claude, ChatGPT or Gemini do) lose their interactive parts.

The page also loads from local storage rather than a web address. Anything it pulls from a sibling file, such as images, a CSS file or a JSON data file, is missing because only the .html file was sent.

What you can try on the phone

None of the on-phone options fix a page that needs its sibling files, and none of them help the next person you forward it to.

  • ✓Files app: long-press the file, choose Share, and look for a browser or an HTML viewer app in the list. What appears depends on the apps installed.
  • ✓Open it on a computer instead. A desktop browser opens .html files from disk and runs their scripts, though linked files still need to sit next to it.
  • ✓Ask the sender for a link. This is the only option that works the same on every phone.

Open it as a link instead

A hosted page opens in Safari at a normal https:// address, runs its scripts and looks the same on iPhone, Android and desktop. If you are the one sending the file, send the link rather than the attachment.

With FileShare Pro: upload the .html file from the dashboard (on a computer, or from the iPhone Files app through the upload button), copy the link and send that. The person opening it needs no account and no app.

If an AI tool made the file

Claude artifacts and ChatGPT canvases are usually downloaded as a single .html file. See downloading a Claude artifact and sharing a ChatGPT canvas for getting the file out, then upload it as above. Sign up free to share your first page.

Related: sending an HTML file on WhatsApp or iMessage and why HTML files do not open from email.

Frequently asked

Can Safari open an HTML file saved on my iPhone?

Not from the Files app directly; iOS shows a preview instead of opening it in Safari. Host the file and open the https:// link in Safari to get the full page.

Why do buttons and charts not work in the preview?

The Mail and Files preview is a document viewer, not a browser tab, so pages that rely on JavaScript lose their interactive parts. The same page opened from a link in Safari runs normally.

Does the person I send the link to need an account?

No. Anyone with the link can open the page in their browser, and guests can comment without signing up.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free