My file manager prompts to open it with HTML Viewer (system app) or various web browsers. But I'm on Android 12. Answer from Exciting-Outside-167 on reddit.com
🌐
Reddit
reddit.com › r/androidquestions › open a local html file on a phone?
r/AndroidQuestions on Reddit: Open a local HTML file on a phone?
September 9, 2024 -

I considered it a no-brainer. I was wrong.

I wanted to take along some files to read when I'm out of network reach or in flight mode. The files happen to be quite plain HTML files, no script, just a CSS file defining the simple layout, and that's it. So I copied the HTML and the CSS files onto my phone and tried to open them.

First attempt was from a file manager. It told me that it no idea what to do with an HTML file. I then tried to look for an "open file" entry in Chrome. Nope. Same in Firefox. Then I tried to force-open the files by using a file:///path/to/file style URL - and it actually submitted the whole string to Google as a search string, as if Chrome (and Firefox) had been lobotomized of the file: protocol.

Now I'm at a loss - is there no way to open a simple HTML file on an Android 13 phone?

🌐
TutorialsPoint
tutorialspoint.com › how-do-you-open-html-files-on-your-phone
How do you open HTML files on your phone?
Depending on your settings, the file will open either in a regular web browser or in an HTML viewer. A different option is to open the browser on your Android smartphone and enter "file:///path/to/your/file.html" in the address bar.
Top answer
1 of 3
10

You have 2 options:

  • You can use a local web server in your Android phone itself. There are many server apps out there in the Play Store, one such app is Simple HTTP Server.

  • You can put your documents into the folder Android/data/com.android.chrome/files/Download/ in the internal storage. It's absolute path is /storage/emulated/0/Android/data/com.android.chrome/files/Download/ or /sdcard/Android/data/com.android.chrome/files/Download/. This is the location where Chrome stores any downloaded files and therefore, this the only location where Chrome can access the files. But remember, uninstalling Chrome will delete this directory.

2 of 3
6

For Android 11 [One UI 3.1]

Browsing local files (in internal storage space) in Chrome using file:///sdcard/ or file://localhost/sdcard/, one can notice that only media files and subdirectories (if any) are listed in almost every folder except the "Download" folder (but not in its subfolders=subdirs).

This means that on Android 11, the folder from which Chrome can read local (m)HTML is /Download folder, not Android/data/com.android.chrome/files/Download in internal or external storage space like in Android 10.

NOTE: on my Samsung devices, downloads onto internal storage were saved into /Download folder in all versions of Android (9, 10, 11), but downloads on an external SD card changed their folder from /storage/emulated/exSD_CARD/Android/data/com.android.chrome/files/Download in Android 10 to /storage/emulated/exSD_CARD/Download in Android 11, where exSD_CARD is the device's label for external SD card (0123-4567 or 9C33-6BBD in my devices)

Thus, (m)HTML files saved into /Download folder with Chrome (with .mhtml extension from older times or with manually added extension by renaming saved mhtml files without extension - from certain time Chrome stopped to append .mhtml extension to saved mhtml files :) on my devices, I guess from upgrading to Android 10)

This did not work for the mhtml files which have been moved to other folders and then returned to /Download folder. (And because of collecting saved mhtml files in many different folders, I have many mhtml files which are necessary to copy/move back to /Download folder prior to opening but they still cannot be opened)

Notes about opening mhtml files

I need to use Total Commander's "Open with" functionality with file://url option checked, then choose Chrome in order to open (mhtml) file with Chrome (with file://url checked, the Chrome is in the list to choose from, with file://url option unchecked, it is not listed in the list) or to browse local files in internal storage directly in Chrome (file manager My Files provided with the device was unusable to choose mhtml files to be opened with Chrome)

(mhtml) files from /Download folder opened in this way are opened as offline versions of downloaded web pages - but only if the file was not moved and returned back to /Download folder, otherwise you get Access Denied message. Also, opening (mhtml) files in this way using Total Commander, but from other folders than /Download folder, leads to Access Denied message

Opening mhtml files from any folder using Total Commander, but with file://url option unchecked (in this case, the Chrome is not in 1st list, so you need to choose "Open with *" option with folder icon from the list and subsequently choose Chrome from next list) behaves differently. Opening in such a way leads not to successful opening or Access Denied message but to Save as Dialog Form in which one can choose also if the resaved mhtml file should be saved to internal storage or external SD card (if present). In this way, resaved mhtml files in /Download folder (on internal or external storage space) can be now opened using Total Commander "Open with" dialog with checked file://url option.


Still, there exists a way of opening the (m)HTML files with Chrome

  • without other browsers/viewer
  • without rooting the Android device

but maybe only until the next update :)

🌐
Mozilla Support
support.mozilla.org › en-US › questions › 1329243
Open local html file on android | Firefox for Android Support Forum | Mozilla Support
I use File Manger Plus (recommended). You can set it to open HTML/txt in Firefox as default app. This is the only way I've manged to make it work. ... Hi This option is currently unavailable in Firefox for Android.
🌐
ConTEXT Editor
contexteditor.org › home › news › how to open html file in mobile
How to open HTML file in mobile
September 3, 2023 - There are several apps available for mobile devices that can be used to open HTML files. These include HTML Viewer, WebMaster’s HTML Editor Lite, and DroidEdit. HTML Viewer is a free app available for both Android and iOS devices.
🌐
Quora
quora.com › How-do-you-open-html-files-on-your-phone
How to open html files on your phone - Quora
Answer (1 of 12): HTML files require a program (as is the case of any file being opened), to be associated with it. The difference being, HTML can contain other types of references within them, which require rendering capabilities. For example an HTML file may contain JavaScript, which would req...
Find elsewhere
🌐
Gadgetroyale
gadgetroyale.com › home › how to open html file in mobile browser (a how-to guide)
How to open html file in mobile browser (A How-to Guide) - Gadgetroyale
November 30, 2023 - Find the location and tap on the app, it will immediately load the html file. Don’t miss Is there an app that will speak what you type · From there you can make changes to the file using your android mobile phone, and it is so easy without any bit of stress or difficulty. The second HTML viewer Android i have for you is the HTML & XML viewer – File opener and reader app for android.
🌐
Droidrant
droidrant.com › home › can i open html file on android?
Can I Open Html File on Android? [Answered 2026]- Droidrant
June 2, 2022 - This means you cannot open them in Chrome or Safari. But, you can open HTML files from Documents. Open the file by selecting it and tapping on the “HTML” icon. Once the file has been opened, you can see the source code. You can then open it in the application’s browser.
🌐
Google Support
support.google.com › chrome › thread › 3131802 › how-open-html-files
How Open html files - Google Chrome Community
Skip to main content · Google Chrome Help · Sign in · Google Help · Help Center · Community · Google Chrome · Terms of Service · Submit feedback · Send feedback on
🌐
XDA Forums
xdaforums.com › home › samsung › samsung galaxy s24 ultra
Question - Open a local html file in Chrome or in Samsung Internet | XDA Forums
February 27, 2024 - It opens Google ... Using a decent file explorer (X-plore / MiXplorer etc) long-press on the desired html file, & choose the browser you want via the "Open with....." option in the file explorer
🌐
Google Support
support.google.com › androidtv › thread › 178943565 › how-can-i-open-my-local-index-html-file-in-android-tv
How can i open my local Index.html file in android TV? - Android TV Community
Skip to main content · Android TV Help · Sign in · Google Help · Help Center · Community · Android TV · Privacy Policy · Terms of Service · Submit feedback · Send feedback on... This help content & information · General Help Center experience · Next · Help Center ·
🌐
Sololearn
sololearn.com › en › Discuss › 1642310 › how-do-you-open-html-files-on-browser-and-is-there-a-way-we-can-on-phones
How do you open html files on browser. And is there a way we can on phones? | Sololearn: Learn to code for FREE!
When you save a html file with ... mobile mobile browsers will automatically open html file on browser when you open them *You accidentally created 2 same question,If ypu delete one then it will help to prevent spam https://www.sololearn.com/Discuss/1642309/?ref=app ... Files with extension .htm or .html should open by default in a web browser...
🌐
GitHub
github.com › gelin › open-in-browser
GitHub - gelin/open-in-browser: Allows to open HTML file or image from a filemanager in a browser on Android · GitHub
You copy the HTML files and images to SD card · You insert SD card to you Android tablet or phone · You opens the index.html from you favorite file manager in your favorite browser · You start reading · PROFIT! Google Play ·
Starred by 4 users
Forked by 6 users
Languages   Java 95.3% | Shell 4.2% | Makefile 0.5%
🌐
ExtensionFile
extensionfile.net › open › html
How to Open HTML File on Windows, Mac OS, Android
The code written in HTML file is directly analyzed by browsers and is a transparent process for the user. To open, edit, create or modify an HTML file, a common text editor is enough, however, we recommend using a highlighting text editor or WYSIWYG (What you see is what you get) so that the ...