Why Your HTML File Looks Broken in iOS Files Preview
Updated 2026-08-09
You tap an HTML file on your iPhone and get a wall of unstyled text, raw code, or a blank screen. Nine times out of ten the file is perfectly fine — the iOS Files preview is simply not a browser, and it silently drops the parts that make the page look like a page.
Here's exactly what gets stripped, how to recognize each failure from its symptoms, and the one-step fix.
What the Files preview actually does
Quick Look — the system previewer behind that tap — renders HTML in a deliberately restricted mode. It's designed for a safe glance, not for fidelity:
- External stylesheets are not loaded — only inline styles survive.
- JavaScript never executes — anything the page builds at runtime simply doesn't exist.
- Files referenced by relative paths — images, fonts, other pages — don't resolve.
- There's no way to grant a page network access, even deliberately.
Diagnosing by symptom
- Readable text, zero styling → the page uses an external or CDN stylesheet that the preview ignored.
- Completely blank → the page is rendered by JavaScript (typical for AI-generated apps and chart pages); with scripts off, there's nothing to show.
- Raw code on screen → the file arrived as .txt or lost its extension in transit; renaming it back to .html restores handling.
- Broken image icons → the images live next to the HTML file; previewing the single file orphans them.
- Garbled characters (中文/日本語 as symbols) → the file uses a legacy encoding like GB18030 or Shift-JIS that the preview read as UTF-8.
The fix: open it in a real renderer
Any of the failures above disappears when the file is opened by something that renders HTML properly. OpenHTML (free) does this on device: share the file to it — or open it once from Files without importing — and the page renders with styles applied and local JavaScript running.
- Multi-file pages: import the folder or ZIP so relative paths keep working — see ZIP web projects on iPhone.
- Legacy encodings are detected automatically, so CJK text renders correctly.
- If something is still off, diagnostics name the exact missing file or blocked resource instead of leaving you guessing — and a one-tap fix follows where possible.
Unlike the preview, OpenHTML lets you allow network access per document when a page truly needs its CDN — while keeping every other page fully offline.
Why not just use Safari?
Safari is a superb renderer with no supported way to feed it a local file plus its assets. Workarounds exist but each has a sharp edge: single files sometimes open via Share → Safari yet lose their neighbors; hosting the file somewhere turns private data into an upload. For files, a viewer app is the boring, reliable answer — the complete guide to opening HTML on iPhone compares all the options.
Free on the App Store — core viewing needs no purchase.
Download OpenHTML