To share an HTML file as a working web page, you need it served from a URL rather than sent as an attachment. The quickest route is a paste-and-share tool. You paste the HTML, it gives you a link, and the other person opens a rendered page in their browser. No server, no repository and no sign-up are needed.
Why sending the .html file doesn't work
You email someone an .html file and one of three things happens. Their mail client blocks it as a possible threat. Their phone shows the raw code instead of the page. Or it opens locally, so every relative path to an image or stylesheet breaks. Even when it works, there is nothing to click in a chat, nothing to open on a tablet and no way to fix a typo without sending the file again.
A link solves all of that. The page renders the same for everyone, it opens on any device and it can be updated in one place.
Option 1: Paste it into a share tool
This is the fastest option for a single page: a prototype, a styled email you want feedback on, a landing page draft, or an exercise for a class.
With HTMLpad the whole process takes three steps:
- Open the page and paste your HTML into the editor.
- Publish it.
- Copy the link and send it.
There is no account. Inline CSS and JavaScript run as they would on any page. Free pads stay online for 90 days, which covers most "can you take a look at this?" moments.
Use this route when the page is self-contained and you want a link now.
Option 2: Use an online code editor
Playgrounds like CodePen or JSFiddle let you split HTML, CSS and JavaScript into panels and share a link to the result. They are built for experimenting and learning, so the shared view usually shows the editor next to the output.
Use this route when the point is the code itself: showing a technique, asking for help with a bug or teaching.
Option 3: Use a static host
If the page is the start of something bigger, a static host such as GitHub Pages or Netlify gives you a permanent address and room to grow into a full site. The trade-off is setup. You need an account and usually a repository or a deploy step, and you'll manage files and folders rather than a single paste.
Use this route when the page needs to live for years, use a custom domain or be part of a multi-page site.
Which one should you pick?
| You want to... | Best option |
|---|---|
| Share one page right now, no sign-up | Paste-and-share tool |
| Show or discuss the code | Online code editor |
| Publish a lasting site or use your own domain | Static host |
A good rule is to start with the lightest option that works. Most HTML that people need to share is a single page that someone will look at a few times. A static host for that is like renting a warehouse to store one box.
A few tips before you share
Make it self-contained. Put CSS in a <style> tag and scripts in a <script> tag. Paths like images/logo.png point to a folder that doesn't exist online, so use absolute URLs for any image instead.
Check it on a phone. Add <meta name="viewport" content="width=device-width, initial-scale=1"> to the <head>, or the page will look tiny on mobile.
Strip anything private. Before you publish, remove API keys, internal URLs and test data. A shared link can be forwarded.
FAQ
Can I share an HTML file without hosting it?
Not as a clickable page. Someone has to serve it from a URL. A paste-and-share tool does that serving for you, so you don't have to set up hosting yourself.
Will my JavaScript work on a shared link?
On a tool that renders the page, yes, as long as the script is inline or loaded from an absolute URL. Scripts that call files on your own computer won't work, because those files aren't online.
How long does a shared HTML link last?
It depends on the tool. On HTMLpad, free pads last 90 days. Static hosts keep pages until you delete them.
Is it safe to share HTML this way?
The page is public to anyone who has the link. Treat it like any published page and keep secrets out of the code.
Hugo Corbett writes about the small, practical side of the web: getting pages online, sharing them and keeping them simple.
