stacktr.ee
By · Founder, Stacktree Last updated
No app to install. Nothing is uploaded.

Open an HTML file on iPhone

To open an HTML file on an iPhone, save it to the Files app, then tap Open a file below and choose it. The page is drawn here in your browser, with its styles and scripts, and nothing is uploaded. To keep it or send it, turn it into a private link.

or

It runs in your browser. Nothing is uploaded.

Your page shows here

Paste HTML above or open a file.

Send this page to someone

Get a private link they can open on any device. No account, a passcode by default, and it lasts 24 hours unless you keep it.

How to open an HTML file on iPhone, step by step

  1. Save the file to Files. If the file came by email, press and hold the attachment in Mail and choose Save to Files. From another app, save it to Files the way that app allows.
  2. Open it in the viewer. On this page, tap Open a file and choose the file from where you saved it. The page is drawn under the box, with its styles and scripts running. Nothing is uploaded.
  3. Give it the whole screen. Tap Expand. Phone shows the page at the phone's own width, and Desktop shows how it looks on a computer, scaled to fit.
  4. Keep it or send it. Tap Get a private link to turn the page into a link you can open again later or send to someone else. This step uploads the page.

Why an HTML file does not just open

Tap a file in the Files app and iPhone opens it. For a file with no app of its own, what opens is a preview: Apple's iPhone User Guide says that if you have not installed the app that created a file, "a preview of the file opens in Quick Look."

A preview is not a browser tab. A developer on Apple's developer forums reported in July 2022, on iPadOS 15, that the Files app drew their HTML file "with only the internal text and internal header contained CSS styling" and did not load the images the page referenced. That is one person's report, not Apple's documentation.

The way around it is to hand the file to something that is a browser. The viewer on this page is a web page: it reads the file you choose and draws it in a frame, so the page gets a real browser engine with its CSS and JavaScript.

What works in the viewer, and what does not

  • Works: one self-contained .html file up to 10 MB, with its styles and scripts written into the file or loaded from web addresses. Buttons, tabs and charts run.
  • Missing: stylesheets, scripts and images kept as separate files beside the HTML. Only the one file is read.
  • Limited: the page runs in a sandbox with no cookies and no browser storage, so a page that saves what you enter may show an error.

The file stays on the phone. It is read in the browser, it is not sent to Stacktree, and it is gone when you close the tab. More about the HTML viewer.

Keep it, or send it to someone

The viewer shows the page for as long as the tab is open. To come back to it, or to show it to someone else, tap Get a private link. That uploads the page to Stacktree and gives you an unguessable link, with a passcode unless you turn it off. A link opens in any browser on any phone or computer, which a file does not.

The link lasts 24 hours. Keep it in a free account and it stays at the same address for 7 more days, using one of the account's 3 pages. If the page is for a client, see how to share an HTML file as a link.

If the file came by email

In the Mail app, press and hold the attachment, then choose Save to Files. Those are the steps in Apple's iPhone User Guide, read on 24 November 2026. The file is then in the Files app, ready to choose from this page.

Be careful with an .html attachment from a sender you do not know. Malicious HTML attachments are a documented attack technique, which Microsoft calls HTML smuggling, and it is why mail filters distrust them. The viewer keeps the page in a sandbox, but a page can still show a form, so do not type a password into one.

FAQ

Frequent questions

How do I open an HTML file on my iPhone? +
Save the file to the Files app, then open a web-based HTML viewer such as the one on this page, tap Open a file and choose it. The page is drawn in the browser with its styles and scripts. Tapping the file in Files instead opens a preview, which can leave parts of the page out.
Why does my iPhone show a preview instead of the page? +
Because the Files app previews a file when the app that made it is not on the phone. Apple's iPhone User Guide says that when you have not installed the app that created a file, a preview of the file opens in Quick Look. A developer on Apple's forums reported in July 2022 that the Files preview drew the text and the CSS in the file's head and did not load the images it referenced.
Do I need an app to open HTML files on iPhone? +
Not for a single self-contained file. The viewer on this page is a web page, so there is nothing to install: you choose the file and it is drawn in the browser. An app is worth having if you work with whole folders of HTML, CSS and images, because the viewer reads one file at a time.
Is the file uploaded when I open it here? +
No. The viewer reads the file in your browser and draws it on this page. It is not sent to Stacktree or anyone else and it is not saved. Only the optional last step, Get a private link, uploads the page, so that it has an address you can open later or send.
Why are the images or styles missing from my page? +
They are separate files. The viewer reads the one .html file you chose, so a stylesheet or image stored beside it does not come along. Images and styles written into the file, or loaded from a web address, do show. For a whole folder, zip it and publish the zip as a link.
How do I save an HTML email attachment on iPhone? +
In the Mail app, press and hold the attachment, then choose Save to Files. Those are the steps in Apple's iPhone User Guide. The file is then in the Files app, where the viewer on this page can open it.
How do I send an HTML file to someone who is on an iPhone? +
Send a link instead of the file. Open the file in the viewer, tap Get a private link, and send that link. They tap it and the page opens in their browser as a page, with nothing to save or install. A passcode is on by default, and the link lasts 24 hours unless you keep it.
Is it safe to open an HTML file someone sent me? +
Treat it like a link from the same sender. The viewer draws the page in a sandbox that cannot read this site or redirect your tab, but it is not a virus scan, and the page can still show a form. Do not type a password or card number into a file from someone you do not know.
Keep reading

Related

References

Sources and further reading