# How To Open an HTML File on Android (Gmail, Files, Chrome, Samsung)

Canonical: https://commareports.com/open-html-file-on-android
Published: 2026-11-12

> Tapping an .html file on Android shows raw code, does nothing, or opens a blank page. Which app actually renders it, why content:// URIs break reports that load CSS or data, and the fix that works on every phone.

# Opening an HTML file on Android

You got `report.html` in Gmail, Slack or a download. You tap it, and one
of four things happens:

- You see **raw markup** — angle brackets and all.
- **Nothing happens**, or Android says no app can open this file.
- It opens in a browser but is **unstyled** — black text, blue links,
  images missing.
- It opens **blank**.

Each has a different cause. The first two are about which app gets the
file. The last two are about the file itself, and no Android setting fixes
them.

## Step 1: get it into a browser, not a viewer

Android doesn't have one default app for local HTML. Gmail's attachment
preview, text editors, and most apps called "HTML Viewer" show the
**source**, not the page. You need a browser.

1. **Save the file.** In Gmail, tap the download icon on the attachment,
   so it lands in `Download/`.
2. **Open your file manager** — Files by Google on Pixel and most phones,
   My Files on Samsung.
3. **Tap the file** and pick **Chrome** (or Samsung Internet) from the
   _Open with_ list.
4. Not offered? **Long-press → ⋮ → Open with** and choose the browser
   explicitly. If you previously picked "Always" for a text app, clear it
   under _Settings → Apps → that app → Open by default_.

Some phones list a system **"HTML Viewer"** in that chooser. It is a
bare-bones renderer for simple markup — expect scripts and anything
interactive not to work. Pick the real browser.

## Step 2: if it opens but looks broken

### Unstyled, missing images, or blank: it was never one file

Most tools that produce "an HTML report" produce a **folder** —
`index.html` plus `css/`, `js/`, `data/` and images. Playwright, Allure,
coverage reports (`genhtml`, `coverage.py`), Sphinx, `nbconvert` with
external assets and Storybook all do. Send only the `.html` and every
reference in it points at a file that isn't on the phone.

### Why even the full folder doesn't help on Android

On a laptop, `file:///…/index.html` can at least load
`file:///…/css/style.css` next to it. On Android, the Files app hands
Chrome the file through a **`content://` URI** — a handle to one file,
with no folder behind it. A relative `style.css` resolves to a
`content://` address the file provider doesn't serve, so it fails even if
you unzipped the whole folder onto the phone.

And reports that fetch their data at view time (`fetch('data.json')`) hit
the same wall that breaks them on a desktop — a local file has an
**opaque origin**, so the request is refused. See
[the same-origin policy and `file://`](/glossary/same-origin-policy) and
[CORS error: origin 'null'](/fix/cors-error-file-origin-null).

### "Can't I just type the path into Chrome?"

`file:///sdcard/Download/report.html` used to work. Since **scoped
storage** (Android 10 and 11), Chrome generally can't read shared storage
by path, and you get `ERR_ACCESS_DENIED` or `ERR_FILE_NOT_FOUND`. Don't
spend time on it.

### Opens, but tiny

That's the page, not Android — a desktop layout with no viewport tag.
See [HTML report is tiny on a phone](/fix/html-report-tiny-on-phone).

## The fix that works on every phone: a URL

A browser is very good at opening web pages and very bad at opening local
files. So stop sending a file.

Whoever has the report on a computer drags the file — or the whole output
folder, or a zip — into [Comma](https://commareports.com/) and sends the
link:

- `index.html` becomes the report, assets upload alongside it, and
  relative references are rewritten to the uploaded copies — so the CSS,
  images and data come with it.
- Scripts run in a sandboxed iframe, so interactive reports (sortable
  tables, charts, expandable failures) stay interactive on the phone.
- It opens in Chrome on Android exactly like any other page. No download,
  no Files app, no _Open with_.

Want to keep it as a file instead? The free
[HTML inliner](/tools/html-inliner) folds a report folder into **one**
self-contained `.html` with the CSS, JavaScript and images embedded —
that file survives being attached and opens from the Files app. It can't
fix a report that fetches data at runtime; for those, use the link.

## Is it safe to open?

An `.html` file can carry scripts, and opening it in your browser runs
them on your device. Treat it like any attachment: only from senders you
trust. Comma renders report HTML in a sandboxed iframe with no
same-origin access, so a script in a report can't reach your session,
cookies or storage — a containment boundary, not a malware scanner.

## Try it

Comma is free — unlimited reports, unlimited commenters, unlimited
revision history. Readers don't need an account to view a shared link.

**[Turn the file into a link →](https://commareports.com/)**

### Related

- [Open an HTML file on iPhone](/open-html-file-on-iphone) — the iOS version
- [Someone sent me an HTML file](/open-html-file-online) — on a computer
- [HTML file shows code instead of the page](/fix/html-file-shows-code-instead-of-page)
- [Why the report lost its CSS](/html-report-broken-css)
- [HTML inliner](/tools/html-inliner) · [Email an HTML report](/email-html-report)
