Someone sends you an .html file on WhatsApp or email, or you are learning to code on the only device you own, a phone. Every tutorial you find assumes a laptop with VS Code installed. This guide is the missing mobile version: three real ways to open, run and even edit HTML on Android or iPhone, what each is good for, and why some saved pages look broken when you open them from your file manager.
The good news: a modern phone browser is a perfectly capable HTML engine. The rendering is identical to desktop Chrome or Safari, the only thing missing is a convenient workflow, and that is exactly what we fix below.
The three routes at a glance
Each route answers a different need, and picking the right one saves the most time. The table below is the short version of everything this article covers, most people want the last row.
| Route | Best for | Can edit code | Styling stays intact | Needs install or account |
|---|---|---|---|---|
| 1. File manager + browser | Quickly viewing a file you received | No | Only if the file is self-contained | No |
| 2. Dedicated HTML viewer app | Viewing files offline, or when your browser refuses | Rarely | Only if the file is self-contained | Yes, an app install |
| 3. Browser-based editor (recommended) | Editing, testing, learning and sharing | Yes, code and preview side by side | Yes, full CSS and JavaScript | No |
Route 1: open it straight from your file manager (no install)
On Android, the Files app and Chrome between them do the whole job; on iPhone, the Files app has a built-in previewer. The exact steps:
- Android, step 1: open the Files (or My Files) app.
- Android, step 2: find the .html file — usually in Downloads or the folder you saved it to.
- Android, step 3: tap it and pick Chrome when Android asks which app to open it with.
- Android, step 4: the page renders in the browser; if styles or links are missing, see the self-contained-file fix below.
- iPhone, step 1: open the Files app.
- iPhone, step 2: tap the .html file.
- iPhone, step 3: iOS Quick Look shows a preview of the page.
- iPhone, step 4: for anything interactive, continue to Route 3 — Quick Look is a static preview and JavaScript may not run.
For a quick look at a simple page, this is all you need. But the route has real limits that surprise people: you are viewing a frozen copy. Nothing is editable, JavaScript runs with restrictions (Quick Look in particular is a static snapshot), and, the big one, a page saved as a single file can lose its styling entirely, which is the next section.
Why a saved page can look broken on your phone
Here is the most common complaint: 'I opened the HTML on my phone and it shows plain unstyled text.' The cause is almost never your phone. A web page is usually three files, index.html, style.css and script.js, and the HTML connects to the others with relative links like <link rel="stylesheet" href="style.css">. When you send only the .html file, those links point at nothing, so the browser renders bare markup.
Two fixes. If you control how the file is produced, export a single self-contained file with the CSS and JavaScript inlined: CodeLive Studio's Download menu does exactly this with its single-HTML option, and such a file opens perfectly on any phone. If you only received the files, ask for the whole folder in a ZIP, or move to route 3 and run the code in an editor instead of the file manager.
Route 2: a dedicated HTML viewer app
The middle route is a dedicated viewer app. On Android, several free apps literally named HTML Viewer do one thing: you open the app, browse to your .html file, and it renders the page. They are small, work offline, and open files the file manager may refuse. On iPhone this route barely exists as a separate step — the built-in Files preview from Route 1 already does what a viewer app would.
The trade-offs match the file-manager route: you get a rendered page, not an editor. JavaScript runs only where the app allows it, and a page split across several files (index.html plus style.css plus images) can still lose its styling, because relative links inside a local folder are exactly what breaks on phones. Viewer apps also vary wildly in quality, so check ratings and permissions before installing; if you only need a quick look, Route 1 already did it with zero installs.
Route 3 (recommended): run it in a browser-based editor
Instead of opening a dead file, open your code in an online HTML editor with live preview and let the page run the way it was meant to, live, editable and interactive. On a phone this is strictly better than the file manager: you can change the code and watch the result update, which is the entire point of learning HTML.
The workflow is identical on Android and iPhone because the browser does all the work:
- Open the CodeLive Studio editor in Chrome or Safari, no app, no account
- Paste your HTML into the HTML tab (and the CSS/JS into their tabs if you have them)
- The live preview re-renders about a second after you stop typing
- On phones, a floating preview bubble keeps the result visible while you type, no tab switching
- Fix, tweak, experiment; your work auto-saves to the device as you go
Bonus: write HTML directly on the phone (no file needed)
Maybe you do not have a file at all, you just want to code, and the phone is what you have. That works too. Open the same editor, replace the starter markup, and type. The on-screen keyboard is the weak point of mobile coding, and autocomplete is what compensates: CodeLive Studio completes tag names, auto-closes brackets and expands Emmet abbreviations, so building a list is 'ul>li*3' plus Tab instead of thirty individual symbols.
Set honest expectations: you will not write a production app on a 6-inch screen. But lessons, exercises, small pages and quick experiments? Genuinely comfortable, especially with the editor's device-size switcher, which doubles as a reality check for how your page behaves at phone width.
Sharing the result from a phone
The file-manager method makes sharing clunky, you end up emailing files around. The editor route makes it one tap: press Save and you get a permanent link that opens your exact project for anyone. Send it in the same WhatsApp conversation the file came from. No attachments, no 'it looks different on my phone', no account needed on the receiving end.
And when the project is finished, Download gives you either the single self-contained .html file (opens anywhere, styled, including on phones) or a ZIP with the three separate files, ready for a laptop project later.
Which route should you use?
Quick view of a file someone sent, and you only need to read it: file manager. Viewing a page that looks broken: it is missing its CSS, get the full folder or a self-contained file. Offline reading, or a browser that refuses the file: a viewer app. Learning, editing, testing or building on a phone: browser editor, every time. Sharing something you built: save a link instead of sending files.
All three routes run on the device you already own. If you have two minutes right now, open the free editor on your phone, paste the last HTML snippet you remember, and watch the preview react while you type, that loop is the whole experience this article is about.
Try everything from this article live
The CodeLive Studio editor runs the examples above with a one-second live preview no account, no install.
Open the free editorKeep reading
- How to run JavaScript in a browser· Once your HTML opens on the phone, make it interactive, five ways to execute JavaScript today.
- HTML tester: run and debug online· Spot the missing tags and broken layout behind that unstyled mobile page.
- CodeLive Studio HTML editor· The no-signup editor with live preview used in the routes above, works in any mobile browser.



