How to open an HTML file on Android (and get it to work like a web page)
Someone sent you an .html file, or an AI tool made one, and your Android phone will not open it, shows raw code or shows a half-broken page. Why that happens and the way to open it as a working page.
Tap an .html attachment in Gmail, WhatsApp or the Files app on Android and one of three things happens: a "can't open file" or "no app can perform this action" message, the page source shown as text, or the page opening in a browser with missing images, empty charts or dead buttons. Which one you get depends on the phone maker, the Android version and the apps installed.
Why the file does not behave like a web page
Android hands the file to whatever app says it can open .html. On many phones that is no app at all, or a text viewer that shows the markup. Chrome and other browsers are not always offered for a file stored on the phone.
When a browser does open it, the page loads from a local content:// address rather than a web address. Anything the page pulls from a sibling file, such as images, a CSS file or a JSON data file, is missing because only the .html file was sent. Some scripts that fetch data also refuse to run from a local address.
What you can try on the phone
None of the on-phone options fix a page that needs its sibling files, and none of them help the next person you forward it to.
- ✓Files by Google or your phone's file manager: tap the three-dot menu on the file, choose Open with, and pick Chrome or another browser if it is listed.
- ✓Install an HTML viewer app from the Play Store. These show the page but often do not run JavaScript the way a browser does.
- ✓Open it on a computer instead. A desktop browser opens .html files from disk and runs their scripts, though linked files still need to sit next to it.
- ✓Ask the sender for a link. This is the only option that works the same on every phone.
Open it as a link instead
A hosted page opens in Chrome at a normal https:// address, runs its scripts and looks the same on Android, iPhone and desktop. If you are the one sending the file, send the link rather than the attachment.
With FileShare Pro: upload the .html file from the dashboard (on a computer, or from the phone browser through the upload button), copy the link and send that. The person opening it needs no account and no app.
- ✓Spot a mistake after sending? Replace the file without changing the link. The link you already sent shows the new version.
- ✓The person can comment on the page itself without signing up.
- ✓Shared pages carry a noindex header, so they stay out of Google.
- ✓A page that loads images or data files needs those too: make it self-contained or upload it as a multi-page site.
If an AI tool made the file
Claude artifacts and ChatGPT canvases are usually downloaded as a single .html file. See downloading a Claude artifact and sharing a ChatGPT canvas for getting the file out, then upload it as above. Sign up free to share your first page.
Related: opening an HTML file on iPhone, sending an HTML file on WhatsApp or iMessage and why HTML files do not open from email.
Frequently asked
Sometimes. Use Open with from your file manager and pick Chrome if it is offered. Images, styles and data files that sit beside the .html file will still be missing. Hosting the file and opening the https:// link avoids both problems.
No installed app has registered to open .html files from storage. Installing a browser or HTML viewer can add one, or the sender can share a link instead.
No. Anyone with the link can open the page in their browser, and guests can comment without signing up.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free