Someone emailed me an HTML file: how do I open it from Gmail?
Quick answer
To open an .html attachment from Gmail, download it and open it in a browser: tap Download in the Android app, or hover over it on a computer and click Download. Gmail's help doesn't say what its preview shows for an .html file, and on an iPhone it gives Save to Drive, not Download. Or ask the sender for a link.
Free plan: no credit card, 1 published page.
On this page
A teacher emails a quiz as quiz.html. A client sends a page an AI built for them. You open the email in Gmail, tap the attachment, and want the page they saw, with its buttons working. Gmail's help doesn't say what its preview shows for an .html file, and a page's scripts need a browser to run. This guide covers how to get the file out of Gmail on Android, on an iPhone or iPad, and on a computer, how to open it so it works, and what Gmail's warnings mean. If you're the one sending, How to send an HTML file by email covers your side.
The Gmail, Google Drive, Android, Chrome, and Apple help pages quoted here were read on November 6, 2026. We didn't test the Gmail app or Gmail on the web. The device results below come from our earlier tests of the file itself, on an Android emulator, an iPhone simulator, and a Mac.
The quickest way on any phone or computer: download the attachment (on an iPhone, save it to Files as in step 2), open Convika's free HTML viewer in your browser, tap or click Choose an .html file, and pick the file. Your browser reads the file, and it isn't uploaded. If someone sent you a file you weren't expecting, ask them first, and turn off Run scripts before you choose it.
What Gmail does with an .html attachment
Gmail's help covers downloading an attachment, saving it to Google Drive, scanning it for viruses, and warning you about some attachments. It doesn't list the file types its preview opens, and it doesn't say what you see when you tap or click an .html file. The closest Google comes is Google Drive's help, which lists .HTML under "Markup/Code" among "the most common file types you can preview in Google Drive". It calls that preview "a scaled-down version of the complete file" and doesn't say whether it runs the page or shows its code.
| What Gmail's help says | Android app | iPhone and iPad app | Computer (Gmail on the web) |
|---|---|---|---|
| Download the attachment to your device | Yes: Download | For a photo, yes: Download. For other files, Google doesn't say | Yes: hover over it, then Download |
| Save it to Google Drive | Yes: Save to Drive | Yes: Save to Drive, for ".pdf files and other file types" | Yes: Add to Drive |
| List the file types its preview opens | Google doesn't say | Google doesn't say | Google doesn't say |
| Show an .html file as a working page | Google doesn't say | Google doesn't say | Google doesn't say |
| Scan attachments for viruses | Yes | Yes | Yes |
| Warn when an attachment "allows unverified scripts" | Yes | Yes | Yes |
| Put .html on its list of blocked file types | No | No | No |
Gmail's help says it "notifies you about suspicious attachments in the email", and names 3 reasons an attachment may be suspicious. The first is "The attachment allows unverified scripts: We can't confirm that the message's attachments are safe to open." Google doesn't say which file types get that warning. Its advice: "If the email looks suspicious, don't reply and don't download the attachment," and "If the email is from someone you know and trust, ignore the warning."
Open an HTML attachment from Gmail in 4 steps
These steps get the file onto your device and open it in a browser, where its scripts run. Nothing is uploaded.
1. Check who sent it
Look at the sender before you touch the attachment. If you weren't expecting a file, ask the person by phone or in a new message, not by replying. If Gmail shows a warning on the email, follow its advice and don't download from an email that looks suspicious. Is it safe to open an HTML file? lists the red flags.
2. Download the attachment
- Android: open the Gmail app, open the email, and tap Download, as Gmail's Android help gives it. Google doesn't say where the file goes. Android's help says "you can usually find your files in the Files app."
- Computer: at the bottom of the message, hover over the attachment and click Download. Gmail's help says "Your browser saves attachments to a download folder."
- iPhone or iPad: Gmail's help gives Download only for a photo, and doesn't say how to save another kind of file to your device. For other files it describes Save to Drive: tap the attachment to open it, then tap Save to Drive at the top right. Then, in the Google Drive app if you have it, tap More next to the file, tap Open in, then Save to Files, choose a folder, and tap Save, as Drive's help describes. If your Gmail account is also in Apple's Mail app, touch and hold the attachment there and choose Save to Files, as Apple's Mail guide describes.
3. Open it in a browser
- Computer: double-click the file in your downloads, and it opens in the app your computer uses for
.htmlfiles. If that app shows code, open Chrome, press Ctrl + O (⌘ + O on a Mac), and choose the file, as Google's list of Chrome shortcuts gives it. The Windows and Mac guides show how to make a browser the app for every.htmlfile. - Android: open Files, tap the file, choose Chrome, then Just once. In our Android 16 emulator test, Chrome ran the page's scripts and Android's HTML Viewer didn't. On a Samsung Galaxy, the file app is My Files: see how to open an HTML file on a Samsung phone.
- iPhone or iPad: Apple's Files guide says: "If you haven't installed the app that created a file, a preview of the file opens in Quick Look." That preview ran no JavaScript in our iOS 26.3 test, so a quiz or a game won't respond there. Use step 4 instead.
4. Or open it in the HTML viewer
Open Convika's free HTML viewer in your browser and tap or click Choose an .html file. On Android, if the file picker opens on Recent, open the menu at the top left and choose Downloads. On an iPhone, pick the file from the folder you saved it in. The page runs inside the viewer with its scripts, and the file isn't uploaded. The viewer opens .html and .htm files up to 2 MB. If someone sent you a file you weren't expecting, ask them first, and turn off Run scripts before you choose it.
Why the attachment won't open or download
- The sender used confidential mode. "If the sender turned on confidential mode, you won't be able to copy or download the message text and attachments," Gmail's help says. Ask them to send it again without it, or to send a link.
- Gmail found a virus. Gmail scans attachments, and "If Gmail finds a virus in an attachment on an email that's already in your inbox, you won't be able to download the attachment." Delete the email.
- Gmail couldn't scan it yet. The error "Gmail virus scanners are temporarily unavailable" means Gmail can't scan certain files at the moment. Google's advice is to try downloading it later.
- Your browser, on a computer. For attachments that won't download, Gmail's help says to check that you're using a supported browser, turn off your browser's extensions one at a time, and clear its cache and cookies.
- It opened, but shows code or doesn't respond. The app that opened it isn't a browser, or runs no scripts. Open it in a browser, as in step 3. If pictures and styles are missing, the page needs files that were saved next to it, and only the
.htmlfile came with the email. Why does my HTML file open as code (or a blank page)? goes through each cause.
Ways to open it, compared
| Way to open it | Extra app needed | Scripts run | Who sees the page |
|---|---|---|---|
| Tap or click it in Gmail (the preview) | No | Google doesn't say | Only you |
| Double-click it on a computer | No | Yes, when it opens in a browser: in our macOS 26.5.2 test, Chrome ran the scripts inside a test file opened from disk. We didn't test a double-click | Only you, on that computer |
| Files on Android, then Chrome | Chrome | Yes, in our Android 16 emulator test | Only you, on that phone |
| Files on Android, then HTML Viewer | No, it came with the emulator | No, in the same test | Only you |
| Files on an iPhone (Quick Look) | No | No, in our iOS 26.3 test | Only you |
| Convika's HTML viewer, in any browser | No, it's a web page | Yes, unless you turn off Run scripts | Only you, on that device |
| A link from the sender | No | Yes, if the host runs them | Everyone with the link, on any phone or computer |
Is an HTML attachment in Gmail safe to open?
Gmail doesn't block .html files by type: its list of blocked file types has .hta, .js, and .exe, but not .html. Gmail's help says "Attachments in Gmail messages you send and receive are automatically scanned for viruses," and speaks of finding "a known virus." A phishing page needs no virus: Microsoft's researchers have documented HTML attachments that show a fake sign-in box and send the password to the attacker, as Is it safe to open an HTML file? explains.
So open one only if you expected it and know who sent it. To look at a file you weren't expecting without running it, open the HTML viewer and turn off Run scripts before you choose the file: the page then shows its HTML and CSS only. Don't type a password into a page that came as an attachment.
Ask the sender for a link
A link skips every step above. The sender puts the page at a web address and pastes that address into the email. You tap it in Gmail, and the page opens in your browser with its buttons working, if the host runs its scripts. Convika is one such host: the sender uploads the file, publishes it, and sends an address like yourpage.convika.page.
If you're the sender, How to send an HTML file by email covers attaching the file in Gmail, Outlook, and iPhone Mail, and the 4 steps to send it as a link instead. How to share an HTML file as a link compares other free hosts.
Frequently asked questions
How do I open an HTML file attached in Gmail?
Download it, then open it in a browser. In the Android app, tap Download; on a computer, hover over the attachment and click Download. Then open the file from Files with Chrome on Android, or double-click it on a computer. Convika's free HTML viewer opens it in any browser without uploading it. If you weren't expecting the file, ask the sender first, and turn off Run scripts before you choose it.
Can Gmail preview HTML files?
Google doesn't say. Gmail's help on opening attachments doesn't list the file types its preview opens or describe what an .html file shows. Google Drive's help lists .HTML among the "Markup/Code" files Drive can preview, as "a scaled-down version of the complete file", and doesn't say whether that preview runs the page. To see the page working, download the file and open it in a browser.
Why can't I open an HTML attachment in Gmail?
Gmail's help gives these reasons an attachment won't open or download: the sender turned on confidential mode, Gmail found a virus in it, its virus scanners were temporarily unavailable, or, on a computer, something in your browser, such as an extension. If the file downloads but shows code, the app that opened it isn't a browser. Open it in Chrome or another browser instead.
How do I open an HTML attachment from Gmail on my iPhone?
Gmail's iPhone help doesn't say how to save an .html file to your iPhone. It gives Download for photos and Save to Drive for other files. Save it to Drive, then in the Google Drive app tap More, Open in, and Save to Files. In Safari, open Convika's HTML viewer and choose the file: its scripts run there, which they didn't in the Files preview in our iOS 26.3 test. If you weren't expecting the file, turn off Run scripts first.
Where do Gmail attachments download on Android?
Gmail's Android help doesn't say. Android's help says "you can usually find your files in the Files app," and that if you can't find that app, "your device manufacturer might have a different app." Open Files and look in Downloads. On a Samsung Galaxy, the app is My Files.
Is it safe to open an HTML attachment in Gmail?
Yes, if you expected it and know who sent it. Gmail scans attachments for known viruses and doesn't block .html files, and an HTML file can show a fake sign-in box without carrying a virus. If you weren't expecting it, ask the sender in a new message. Then read it as text, or open it in the HTML viewer with Run scripts off, before you open it in your browser. Don't type a password into it.
What does "The attachment allows unverified scripts" mean in Gmail?
It's one of 3 reasons Gmail's help gives for marking an attachment suspicious: "We can't confirm that the message's attachments are safe to open. If you open the attachments, there's a chance malicious software will run on your computer or device." Google says not to download the attachment if the email looks suspicious, and to ignore the warning if the email is from someone you know and trust. Google doesn't say which file types get this warning.
Sources
- Open & download attachments in Gmail, Android phone & tablet (Gmail Help) (checked November 6, 2026)
- Open & download attachments in Gmail, iPhone & iPad (Gmail Help) (checked November 6, 2026)
- Open & download attachments in Gmail, Computer (Gmail Help) (checked November 6, 2026)
- Anti-virus scanning attachments (Gmail Help) (checked November 6, 2026)
- File types blocked in Gmail (Gmail Help) (checked November 6, 2026)
- Files you can store in Google Drive (Google Drive Help) (checked November 6, 2026)
- Download a file, iPhone & iPad (Google Drive Help) (checked November 6, 2026)
- Find & delete files on Android (Android Help) (checked November 6, 2026)
- Chrome keyboard shortcuts (Google Chrome Help) (checked November 6, 2026)
- Find and view files and folders in Files on iPhone (Apple) (checked November 6, 2026)
- Download email attachments in Mail on iPhone (Apple) (checked November 6, 2026)
Next step
How to password protect an HTML page without code, on your own domain
JavaScript passwords sit in the page code. Put an HTML page from ChatGPT or Claude behind a server-checked password on your own domain.
Related articles
- How to Send an HTML File by Email (Gmail, Outlook, or Link)Gmail and Outlook let you attach .html files, though work filters can block them and mail apps may show code. Or publish it and email a link instead.
- Is it safe to open an HTML file someone sent me? How to check firstAn HTML file is a web page: it can run scripts and show a fake sign-in box. Open one only if you expected it, and check it as text or with scripts off first.
- How do I open an HTML file in Chrome mobile on Android, and send one that opens?Open an HTML file in Chrome mobile on Android: tap it in Files, choose Chrome, and tap Just once. HTML Viewer ran no scripts in our test. Or use a free viewer.
- How do I open an HTML file on iPhone in Safari, and send one that opens?Open an .html file on iPhone in Safari: save it to Files, open a free HTML viewer, and choose it so its scripts run. The Files preview ran none in our test.
- Why does my HTML file show code or a blank white page?An HTML file shows code in a text editor or under a .txt name, and goes blank when its script can't run. Each fix, and what file://error_page_loaded.html is.
- How to open an HTML file in Chrome (computer, iPhone, and Android)Open an .html file in Chrome with Open with or Ctrl + O, make Chrome the default, run it from the terminal or VS Code, and what works on a phone.
AI Skill Pod
Share AI skills with your team, the easy way
Everyone uses your team's skills in their own ChatGPT, Claude or Gemini, on any plan. Send one invite link. Free to start.
Start free on AI Skill Pod