# How to open an HTML file on iPhone · Stacktree

Source: https://stacktr.ee/open-html-file-on-iphone

[Skip to content](#main) PFrom Product Hunt? Your first pages are free, no card. Code `PRODUCTHUNT` takes 50% off your first month of Studio.[Start free &rarr;](https://app.stacktr.ee/?join=1&from=producthunt)

&times;   A Stacktree customer sent you. Your first month is 50% off on any plan, taken off at checkout. [Start free &rarr;](https://app.stacktr.ee/?join=1&from=referral)

 &times;      [stacktr.ee](/)   [Examples](/#proof) [How we use it](/how-we-use-stacktree) [Pricing](/pricing) [Security](/security) [Log in](https://app.stacktr.ee) [Publish one](https://app.stacktr.ee/?join=1)     By [Steve Smith](/about) · Founder, Stacktree Last updated November 24, 2026         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.

    Paste HTMLorOpen a fileIt runs in your browser. Nothing is uploaded.

Load a sampleClearDesktopTabletPhoneExpandYour 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.

Get a private link

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

  - 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.
- 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.
- 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.
- 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](/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](/share-html-file-with-client).

## 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](/share-html-file-with-client).   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

   -  [ HTML viewer The same viewer for any device: paste HTML or open a file and see the page. ](/html-viewer)
-  [ Share an HTML file as a link Send a link instead of an attachment, with a passcode if you want one. ](/share-html-file-with-client)
-  [ Password-protect an HTML page Gate a page with a passcode the reader types, no account for them. ](/password-protect-html-page)

References

## Sources and further reading

   -  [ Apple, iPhone User Guide: Find and view files and folders in Files on iPhone ↗ Tapping a file opens it, and a file with no app of its own opens as a preview in Quick Look. Read on 24 November 2026. ](https://support.apple.com/guide/iphone/find-and-view-files-and-folders-iphe4bff8827/ios)
-  [ Apple, iPhone User Guide: Download email attachments in Mail on iPhone ↗ Press and hold an attachment, then choose Save to Files. Read on 24 November 2026. ](https://support.apple.com/guide/iphone/download-email-attachments-iph7fe7a50a7/ios)
-  [ Apple Developer Forums: testing local HTML with relative references on iPadOS 15 ↗ A developer's July 2022 report of what the Files app draws from a local HTML file and what it leaves out. ](https://developer.apple.com/forums/thread/710001)
-  [ Microsoft Security: HTML smuggling ↗ Why an .html attachment from a stranger deserves care. ](https://www.microsoft.com/en-us/security/blog/2021/11/11/html-smuggling-surges-highly-evasive-loader-technique-increasingly-used-in-banking-malware-targeted-attacks/)
       stacktr.ee  [How we use it](/how-we-use-stacktree) [Client project tracker](/client-project-tracker) [Weekly work report](/weekly-work-report) [Tester kit](/tester-kit) [Page video](/page-video) [Ask this page](/ask-this-page) [Client feedback](/client-feedback-loop) [Client spaces](/client-spaces) [Templates](/templates) [Use cases](/use-cases) [Integrations](/agents) [Alternatives](/alternatives) [About](/about) [Blog](/blog) [Changelog](/changelog) [Pricing](/pricing) [Security](/security) [FAQ](/faq) [Made with Stacktree](/made-with)  Building with AI agents? See the [developer docs &rarr;](/developers)

---
Full markdown summary of the Stacktree marketing surface: https://stacktr.ee/llms-full.txt
