How to share an HTML file as a link that opens as a web page
Share an HTML file as a live link
To share an HTML file as a link that opens as a real web page, upload it to a host that renders HTML rather than offering it as a download. Inline your CSS and JavaScript so it is one self-contained file, drop it in, and copy the link. Anyone who opens it sees the live page in their browser, with no server, no domain and no build step on your side. Here is how, what works inside the page, and when you need a ZIP site instead.
At a glance
- Single .html file
- Free on every plan, up to 100 MB
- Opens as
- The live page, rendered in a sandbox
- Works
- Inline CSS/JS, CDN scripts, external forms, pop-ups
- Does not work
- Relative files, cookies, localStorage, server code
- Several files?
- Upload a ZIP as a site (Pro: 10, Lifetime: 25)
Why a .html file won't just open for people
An HTML file only becomes a page when a browser loads it from a web address. Attach it to an email and many providers block it, phones show the source code, and some recipients see a security warning. Put it in Google Drive or Dropbox and it opens as a file preview or a download, because running someone else's HTML on a storage domain would be a security hole. What you need is a host whose whole job is to serve that file as a page.
How to share an HTML file as a link
- 1
Make it one self-contained file
Put your CSS in a <style> tag and your JavaScript in a <script> tag, and load images and libraries from absolute https:// URLs or inline them. Exports from Claude, ChatGPT, Jupyter, Lighthouse and test runners usually already are. - 2
Upload the .html file
Drop it into the uploader. Single HTML files work on every plan, including Free. - 3
Copy the link
You get a clean linkinseconds.com/p/… address and a QR code. Opening it renders the real page, not the source code. - 4
Update it in place
Changed the page? Replace the file in Link settings and the same link shows the new version.
What works inside the page
Your page runs in a sandboxed frame. The sandbox allows scripts, forms, alerts and pop-ups, so charts, animations, calculators, quizzes and a form that posts to Formspree or a Google Form all behave normally. What it withholds is same-origin access: your page can't read or set cookies, use localStorage or sessionStorage, or call an API that expects to share the page's origin. That restriction is what protects every visitor from a hostile upload, and it is why the page can be served safely at all.
| In your HTML | Works? |
|---|---|
| CSS in a <style> tag, JS in a <script> tag | Yes |
| Libraries and fonts from a CDN (https://…) | Yes |
| Images as data: URIs or absolute URLs | Yes |
| Forms that post to an external service | Yes |
| Links to styles.css, ./app.js, img/logo.png | No, upload a ZIP site |
| localStorage, sessionStorage, cookies | No, sandboxed |
| PHP, Node, a database | No, static only |
One file or a whole site?
A single file is the right call for an exported report, a one-page invite, a prototype, an email template preview or anything an AI assistant generated. Once the page links to other pages, stylesheets or an image folder, you want a static site: zip the folder (or your framework's dist folder) and publish it. Sites get their own subdomain, relative links just work, and you can add a custom domain. ZIP sites are a Pro feature, with 10 on Pro and 25 on Lifetime. The full walkthrough is in host a static website from a ZIP.
Other ways to share an HTML file
| Option | What actually happens | Good for |
|---|---|---|
| Email the .html as an attachment | Many mail apps block or strip it; phones show code or nothing | Never for a live page |
| Upload to Google Drive or Dropbox | Opens as a file preview or download, not as a web page | Storing the source |
| GitHub Pages | Needs a repository and a push; free sites are public | Developers, long-lived sites |
| Netlify Drop | Drag a folder; a no-account drop is temporary until you claim it | Multi-file sites, with an account |
| Link in Seconds | One file → one link, renders live in a sandbox; ZIP sites are Pro | Sharing one page fast, with a QR and view count |
Common cases
A page Claude, ChatGPT or v0 made for you
Download the artifact or canvas as an .html file and upload it. If you use Claude Code, Cursor or VS Code, our MCP server can publish it and return the link without leaving the chat; see let Claude publish files as links. For multi-file AI builds, see share an AI-built website.
Test, coverage and audit reports
pytest and Jest coverage, Playwright reports, Lighthouse audits and Jupyter notebooks saved as HTML are often a single file already. One link replaces a zip in the team chat, and the view counter tells you someone actually looked.
Email templates and one-page invites
Share a coded newsletter for sign-off, or an RSVP page with a QR code for the printed invite. Change the copy later by replacing the file, the link and QR code stay the same.
Quick answers
How do I share an HTML file so it opens as a web page?
Upload it to a host that renders HTML instead of offering it as a download. On Link in Seconds you drop the .html file in, copy the link, and anyone who opens it sees the live page in their browser, on any phone or computer, with no account.
Why does my HTML file show as code or download instead of opening?
Cloud drives and email treat .html as a file to preview or save, not a page to run, partly for security. To show it as a page it has to be served by a web host. Hosts that render untrusted HTML usually do it inside a sandbox, which is what lets them do it safely.
Will my CSS, JavaScript and images work?
Yes if they are inside the file or loaded from absolute https:// URLs, such as a CDN. Relative paths like styles.css or ./img/logo.png will not load, because only the one file is uploaded. For a page that needs several files, upload a ZIP as a static site instead.
Is it free to host an HTML file?
Yes. A single HTML file is a normal upload on every plan, up to 100 MB on Free. Multi-file ZIP websites with their own subdomain are a Pro feature.
How do I share a Claude artifact or ChatGPT canvas as a link?
Download or copy the generated page as a single .html file and upload it. AI tools usually produce one self-contained file, so it renders as-is. If your assistant supports MCP, it can publish the file and hand you the link directly.
What will not work inside the sandbox?
Anything that needs the page's own origin: cookies, localStorage, sessionStorage and same-origin API calls. Scripts, forms that post to an external service, alerts and pop-ups do run. Server code such as PHP or a database never runs, because this is static hosting.
Go deeper
Turn any file into a link in seconds
Upload a PDF, image, video, or ZIP and get a clean, trackable link with a QR code, free.
Try Link in Seconds →