HTMLKeep
← File guides

Why does my HTML file open as text or code on iPhone?

If you can see literal tags such as <h1> or <p>, save the original attachment to Files and check its full name in Get Info. A text preview, a hidden .txt extension and an export that deliberately displays code need different fixes.

The file is named report.html.txt

Make a copy first. If the copy contains plain HTML source, rename the copy to report.html, then share it from Files to HTMLKeep. If the document includes chat messages, rich text or Markdown code fences, ask the sender for a plain HTML export. Changing the extension on a Word document does not convert its contents to HTML.

The extension is .html and I still see tags

Touch and hold the original file in Files, tap Share and open it with HTMLKeep. If you now see headings and paragraphs, the earlier app was showing the source. If a tag remains visible, ask the author to inspect that line in the export. For example, the source &lt;h1&gt; tells a browser to display the text <h1>. Ask for the original rendered page’s HTML. Replacing every escaped character can damage code examples that belong in the document.

I see unstyled text, but no angle brackets

A readable heading with no visible tags means the HTML is rendering. If the page used to have colors, columns or images, check whether the sender included its other files. Follow a stylesheet and an image through a sample ZIP.

Try a one-line file to isolate the cause

In a plain-text editor, save the following line as a separate file named test.html. Transfer it the same way as the original and open it from Files.

<!doctype html><meta charset="utf-8"><h1>Page works</h1>

A large Page works heading means that route can render HTML. Compare the original export with the test file. If both show the angle brackets, check the viewing app and the complete filenames. If a heading renders but accented letters or Chinese characters look garbled, ask for a copy saved in UTF-8 with a matching charset declaration. That symptom points to text encoding.

Get HTMLKeep on the App Store