How to Open HTML Files on iPhone: The Complete Guide
Updated 2026-08-09
Short answer: the Files app can preview simple HTML, Safari can display a file you got there via workarounds, but the only way to reliably open an HTML file with its styles, scripts and linked resources working is a dedicated viewer app. Here is what each method actually does, so you can pick the right one in ten seconds.
Method 1 — Quick look in the Files app
Tap any .html file in Files and iOS shows a preview. For a fully self-contained page — all CSS inline, no scripts — this can be enough to read the content.
- External stylesheets are ignored, so most real pages lose their layout.
- JavaScript never runs — interactive pages appear frozen or empty.
- Linked files (images, other pages) don't resolve.
Verdict: fine for glancing at simple text content; misleading for anything styled. If your file looks like unformatted text here, the file is fine — the preview is the problem. Details in why HTML looks broken in iOS preview.
Method 2 — Safari
Safari renders HTML perfectly — from a URL. For local files it's awkward: iOS offers no supported way to point Safari at a file with its folder of assets. Workarounds (data URLs, shortcuts, temporary hosting) exist, but they break on multi-file pages and turn a two-tap task into a project. If the page is already online, use Safari; if it's a file, use a viewer.
Method 3 — A dedicated HTML viewer
OpenHTML (free) opens HTML the way a browser would, but from files: share any .html to it, paste HTML code directly, or open a file once from iCloud Drive without importing it.
- Styles apply and local JavaScript runs — network access stays off until you allow it per page.
- Multi-file pages and ZIP archives import as complete projects with working relative paths — see ZIP web projects.
- Diagnostics name every missing file, blocked resource and script error when a page doesn't render right.
- Markdown files open as clean pages too, with offline LaTeX math — see Markdown + LaTeX.
Which method for which file
- A simple self-contained page you just need to read once → Files preview.
- A page that's already on the web → Safari.
- An AI-generated page from ChatGPT or Claude → viewer, so scripts and styles work.
- A saved webpage, an emailed report, a zipped site, anything with more than one file → viewer.
Common problems, quick fixes
- Page is unstyled text → external CSS didn't load; open it in a viewer that applies styles.
- Page is blank → JavaScript is required and wasn't allowed to run; use a viewer with local JS enabled.
- Images missing → they live next to the HTML file; import the folder or ZIP, not the single file.
- Chinese/Japanese text shows as garbage → the file isn't UTF-8; OpenHTML detects legacy encodings (GB18030, Shift-JIS…) automatically.
- Page needs live data → it uses fetch(); run it on the private Local Server (Pro) so it behaves like a hosted site.
A note on privacy
HTML files you receive are often reports with your data in them. OpenHTML keeps files in private on-device storage, has no accounts or analytics, and blocks all network access per page until you opt in — a saved page can't call home without your say-so.
Free on the App Store — core viewing needs no purchase.
Download OpenHTML