How To Share An HTML File So It Opens For Anyone

Want to share an HTML file so it opens as a page, not code? Why attachments fail, five options compared, and the one-minute way to send a link instead.
The OxyPages Team · · 9 min read
You've got an HTML file that looks great on your laptop. Maybe ChatGPT or Claude made it, maybe you built it yourself. Now you want someone else to see it, so you attach it to an email or drop it into WhatsApp.
And on their end it doesn't work. They see a wall of code, a download that goes nowhere, or a page with every image missing.
That's the normal result. An HTML file is written to be opened by a browser from a web address, and most of the places you can send a file treat it as a document instead. To share an HTML file so it opens for anyone, on any device, the reliable move is to send a link to the page rather than the file itself.
This post covers why the raw file fails, five ways people try to get around it, which one I'd pick, and how to handle phones, QR codes and pages you'd rather keep private.
If the file opens badly on your own computer too, fix that first: how to open an HTML file in Chrome covers the local side.
TL;DR: Sending the .html file itself usually fails. Phones show it as code or can't open it, separate images and stylesheets get left behind, and company mail filters treat HTML attachments with suspicion. Cloud drives don't help either: Google Drive shows the code or a download, and its web hosting was switched off in August 2016. The route that works everywhere is to host the file and send the link. Several hosts do it in under a minute, some without an account. Anyone with the link can open the page, so use password protection for anything private.
Why Doesn't The HTML File Open When You Send It?
Because the person receiving it gets a file, not a web page, and their app decides what to do with it. Here's where it usually goes wrong:
- It shows as code. Plenty of mail and chat previewers open an .html file as plain text. The recipient sees tags, not your design.
- It's awkward on a phone. Depending on the app, it opens as a stripped preview or sits in Downloads with no obvious way to open it in a browser.
- The images and styling are missing. If the page loads
images/photo.jpgorstyles.css, those files live in a folder on your computer. Send the HTML alone and the page looks for them and finds nothing. - A filter holds it back. HTML attachments are a common phishing trick, so some work email filters hold them back or strip them before they arrive.
- It needs a computer. Even when it works, the recipient has to download, find and open it in a browser.
- Every fix means sending it again. Spot a typo and you're back to attaching a new copy, and now there are two versions in the thread.
One thing worth clearing up: neither big mail provider blocks .html by default. As of November 2026, Gmail's list of blocked file types includes .hta and .js but not .html. Outlook's blocked attachments list blocks .mht and .mhtml, the single-file saved web page formats, but not .html either. So the email usually arrives. It just doesn't open as a page.
Five Ways To Share An HTML File, Compared

There are five common ways to share an HTML file, and only one of them shows the recipient a working page on every device. This table is the short version.
| Method | What the other person sees | Works on a phone? | Images and CSS | Effort for them |
|---|---|---|---|---|
| Attach the file, open in a browser | The page, if they open it right | Rarely | Missing unless sent separately | Download, find, open |
| Cloud drive share link | Code or a download button | No | Missing | Download, then open |
| Zip the folder and send it | The page, after unzipping | Barely | Kept together | Unzip, find, open |
| Paste into a code-sharing site | The page beside the editor | Yes, but cramped | Only images hosted online | Tap a link |
| Host it and send the link | The page, as built | Yes | Load with the page | Tap a link |
Attach It And Open It In A Browser
This works when the recipient is on a laptop and knows to right-click and choose Open With, then Chrome or Safari.
For everyone else, it's a set of instructions they didn't ask for.
Cloud Drive Share Links
A Google Drive, Dropbox or OneDrive link feels like it should work, and it doesn't. Drive's preview shows an HTML file as source code or offers it as a download, never as a working page.
Google used to let you host web pages from Drive, but that feature was announced as deprecated in August 2015 and switched off on 31 August 2016. A drive is storage, not a web server.
Zip It First
Zipping the folder keeps the HTML, images and CSS together, so the page looks right once it's unpacked. That solves the missing-images problem and creates a new one: the recipient has to unzip it on a computer and find the right file. On a phone it's close to hopeless.
Paste It Into A Code-Sharing Site
CodePen and JSFiddle let you paste HTML, CSS and JavaScript and share a link to the result. That's a decent option for a small demo shown to someone technical. The catch is that images sitting on your computer don't come along, the page shares the screen with an editor, and free pens are public.
If the file came out of an AI chat, the chat may have its own share button. Claude can share an artifact by link, for example, and putting a Claude HTML file online covers when that's enough and when it isn't.
Host It And Send The Link
Hosting means putting the file on a web server so it has its own address, like yourname.example.com. The recipient taps the link and the page opens in their browser exactly as you built it, with images and styling loaded from the same place.
This is the only option in the table that works the same on a phone, a tablet and a laptop. It's what I'd do for almost every case.
How Do You Turn An HTML File Into A Link?
You upload it to a host, copy the address it gives you, and send that address. With a drag-and-drop host the whole thing takes under a minute.
Here's a worked example. Say ChatGPT built you a pub quiz scoreboard as one HTML file, and you want the eight people in your quiz team's WhatsApp group to open it on their phones tonight.
- Check it opens on your computer. Double-click it and make sure it looks right. If it needs a separate images folder, put the HTML and that folder together, or zip them.
- Drop it on a host. On the OxyPages homepage you can drag the file in without an account. Netlify Drop takes a dragged folder too, and GitHub Pages and Cloudflare Pages do the job if you're happy to create an account and take a few more steps.
- Copy the link. You get an HTTPS address in seconds.
- Open it on your own phone first. This catches a missing image or a layout that breaks on a small screen before anyone else sees it.
- Decide how long it needs to live. Some no-account links expire quickly (ours lasts 30 minutes). For a quiz that runs all evening, use a free account so the page stays up.
- Send the permanent link, not the short-lived one.
Found a typo after sending it? Upload the fixed file to the same site and everyone gets the new version.
So the file is online. Now for the people who'll mostly open it on a phone.
Sharing It To A Phone Or With A QR Code
A link is the easiest way to get a page onto a phone, because a phone opens links in its browser without asking anything. Paste it into WhatsApp, iMessage, Telegram or a text and it opens with one tap.
If you only need the link for a day or two, a temporary website link explains how short-lived links work and when to keep one for good.
When people are in the same room, a QR code is quicker than any message. Put the link into a free QR code generator, show the code on your screen or print it, and anyone can point their camera at it. That works well for an event page on a poster, a menu on a table, or a quiz scoreboard projected on the wall.
Make the QR code from the permanent link, not a temporary one. A printed code pointing at an expired page can't be fixed.
Can You Keep A Shared Page Private?

Not with a plain link. Anyone who has the address can open the page, and links get forwarded. A page that isn't listed anywhere is hard to stumble on, but that's not the same as private.
For real privacy you need password protection, where the host asks for a password before showing the page. On OxyPages that's a paid-plan feature, from $4 a month billed annually on Lite, and Free doesn't include it. Other hosts handle it differently. Cloudflare Pages, for example, can sit behind Cloudflare Access, which takes more setup.
Being straight about the limits here. A password keeps casual visitors out, and that's all it does. Don't put anything on a web page, password or not, that you wouldn't want leaked: ID numbers, bank details, medical notes. Send those through a channel built for them.
When Sending The File Is Still The Right Call
Sometimes the other person needs the file itself, and a link would get in the way. Send the raw HTML when:
- They're a developer who's going to edit it.
- You're handing over a finished site to whoever will host it.
- The page uses PHP or a database. A static host won't run either, so hosting it there just shows a broken page, and it needs a real server.
Everyone else wants to look at the page, not own the file. Give them a link.
My Verdict
If you want someone to see your page, don't send the file. Host it and send the link.
Attachments, drive links and zips all push work onto the other person, and most fail on a phone, which is where your page will probably be opened. A link costs you a minute and them one tap.
What To Do Next
Open your HTML file and check it looks right on your own screen. Then drop it on a host, open the link on your phone, and send it once it passes that test.
If you'd like the quickest version of that, turn your HTML file into a link and you'll have an address to send in under a minute, no account needed to try it.
FAQ
Can I Share An HTML File By Email?
You can, and it usually arrives, because Gmail and Outlook don't block .html by default. But on a phone it often opens as code or not at all, and separate images go missing. A link to the hosted page avoids both.
Why Does Google Drive Show My HTML File As Code?
Drive's previewer treats an HTML file as text, so it shows the source instead of the page. Google ended Drive's web hosting in August 2016, and there's no setting to switch it back on. Use a web host instead.
How Do I Share An HTML File On WhatsApp?
Host the file first, then paste the link into the chat. WhatsApp opens links in the phone's browser, so the page appears as built. Sending the .html file itself just gives the other person a document they probably can't open.
Is A Shared HTML Link Private?
No. Anyone with the address can open the page, including people it gets forwarded to. If it needs to stay private, use a host that offers password protection, and keep truly sensitive data off the web altogether.