Videos
How do I open a local HTML file in Safari on iPhone?
What is HTML on iPhone?
How do I open an HTML file in Apple?
I want to read this file but it is in HTML text format and won’t do anything and my google drive won’t load it either
Since the files are always local to the app in iOS. You can't open a html with apps like Safari and Chrome to load associated assets (js/images/css).
However, You could use apps like Documents to upload the folder and open in app browser (uiwebview).
Should work if the URL to assets in the html are relative.
You can create Web Apps for offline viewing by adding them to the home screen. To do this the web page must be written using HTML5 Offline Application Cache. See the below link for further details.
https://developer.apple.com/library/safari/documentation/iPhone/Conceptual/SafariJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html
Turns out Microsoft Edge, unlike Safari, can still open local html files. Discovered in this answer. To wit:
- Install Microsoft Edge from the App Store
- Open
Files(or whatever file browsing app you like). - Open the file, then tap the Share button to send to another app.
- Scroll across to "More...", choose Edge, and voila!
I had the same issue today on ios15.
There is a free app called Koder available on the App Store which will let you edit and view the HTML file. I’m no expert but the editor looks pretty fully featured at first glance.

If the devices are on the same friendly WiFi network, spin up a Python server from terminal (in the directory containing the html file): python -m SimpleHTTPServer Then, get computer's local ip using ifconfig.
On the iPhone, would then go to http://<<computer's local ip>>:8000 for index.html or http://<<computer's local ip>>:8000/<<filename>>.html for any other file.
Examples:
http://192.168.1.2:8000/
http://192.168.1.2:8000/notindex.html
Once the page is opened on your iPhone all you have to do is tap the Sharing icon, middle icon on bottom, and select 'Add to Home Screen'
If you want to load an html file that you've created on you Mac to your iPhone you'll need to do the following. From System Prefs > Sharing > Enable Web Sharing. Place the html file in your ~/Sites folder. Go the the URL listed in the Web Sharing panel from your iPhone, while on the home network, and open the html file. It will load in Mobile Safari.
If you want this to stay on your iPhone you'll need to have the page written in html5 and have a properly setup CACHE MANIFEST. This includes the appropriate tag in the html file and have the proper manifest file. Then you can follow the first step and add it to your home screen and always have it on your iPhone.
I do it using the 'Notes' app on my iphone. Quick and free download.
I emailed the file to myself, then opened it on my phone via email. Inside the email, I clicked the html file. This opened it. I then clicked the download button on the top right of my particular iphone. After that I clicked "Add to Notes".
Inside the notes app, my html file is there and also all functions work as there is also javascript involved.
Once the page is opened on your iPhone all you have to do is tap the Sharing icon, middle icon on bottom, and select 'Add to Home Screen'
If you want to load an html file that you've created on you Mac to your iPhone you'll need to do the following. From System Prefs > Sharing > Enable Web Sharing. Place the html file in your ~/Sites folder. Go the the URL listed in the Web Sharing panel from your iPhone, while on the home network, and open the html file. It will load in Mobile Safari.
If you want this to stay on your iPhone you'll need to have the page written in html5 and have a properly setup CACHE MANIFEST. This includes the appropriate tag in the html file and have the proper manifest file. Then you can follow the first step and add it to your home screen and always have it on your iPhone.