htmlkin.io
Sign in
A woman looking through binoculars

How to share an HTML file so it opens as a web page

Email shows an HTML file as code, Google Drive and Dropbox download it. Here is how to share an HTML file as a link that opens as a real web page, plus when to send a ZIP or use CodePen.

 · updated  · 10 min read

To share an HTML file so the other person sees a web page, put the file online and send them the link. A static host turns report.html into an address like https://report.htmlkin.io in under a minute, and that link opens in any browser, on a laptop or a phone. An attachment or a cloud-drive file reaches the recipient as code or as a download.

The question has become common because AI assistants now hand out HTML. Claude, ChatGPT and Gemini produce reports, slide decks and dashboards as a single .html file, and the person who asked for it then has to show it to someone else. In Google Ads data for the US, searches for "how to share a html file" grew from about 90 a month in September 2025 to 320 in April 2026.

Below: why the file breaks on the way, the fastest way to get a link, every common method with what the recipient actually sees, and what to do when the page has separate CSS, scripts or images.

TL;DR

  • To share an HTML file as a web page, upload it to a static host and send the link. htmlkin, Tiiny Host and Netlify Drop all do this with drag and drop.
  • Email attachments open as code or a download. Google Drive and Dropbox stopped rendering HTML as pages in 2016.
  • If someone needs to edit the code, use CodePen. If they need to open the page offline, zip the folder and tell them to open index.html.
  • If the page uses separate CSS, JavaScript or images, upload the whole folder or a ZIP with index.html at the root.

Why doesn't an HTML file open for the person you send it to?

An HTML file on your computer is a document; a web page is that document served by a web server at an address. When you attach the file to an email or drop it into a chat, the recipient's app decides how to show it, and most apps treat it as a document to preview or download.

That is why the same file behaves differently depending on the route:

  • Gmail on the web shows the attachment preview as raw HTML code. The page renders only after the recipient downloads it and opens it in a browser (University of Michigan IT knowledge base).
  • Google Drive ended web hosting on August 31, 2016 (Google Workspace Updates). A shared .html file opens in Drive's file viewer or downloads.
  • Dropbox stopped rendering HTML in the browser on October 3, 2016 for Basic accounts and on September 1, 2017 for paid and team accounts. Shared links now offer a download (TidBITS, Dropbox Help).

Many forum answers still recommend Drive and Dropbox. Those answers predate 2016.

The second reason is relative paths. If your page loads style.css, app.js or images/logo.png, those files live next to index.html on your disk. Send only the HTML, and the recipient gets a page with no styles and broken images.

The fastest way: turn the HTML file into a link

Upload the file to a static host and copy the address it gives you. On htmlkin this takes four steps and no account:

  1. Open htmlkin.io. The upload form is on the home page.
  2. Drop the file in. A single .html file, a whole folder or a ZIP archive all work.
  3. Pick a name for the subdomain, or keep the random one.
  4. Copy the link, for example https://quarterly-report.htmlkin.io, and send it by email, chat or text message.

The recipient clicks and sees the page: styles, scripts and images work, because a web server delivers them the way a browser expects. Every site gets HTTPS automatically.

Without an account the link lasts 24 hours, which covers a quick review. After a free sign-up the site stays online as long as people visit it: 30 days with no visits move it to an archive, and you can restore it from the dashboard within another 30 days. The free plan includes one site with 20 MB of storage and a custom domain. Details are on the free HTML hosting page.

Two other services work the same way:

  • Tiiny Host — free plan with one page or site up to 3 MB and 5,000 visits a month. Free pages show the Tiiny Host banner, and the account must sign in at least once every three months to keep the link live.
  • Netlify Drop — drag a folder onto the page. Without an account the site sits behind a temporary password, and you have one hour to claim it with a Netlify account before it is removed (Netlify Docs, Netlify blog).

Every way to share an HTML file, compared

The method decides what the recipient sees. Here is the full set, from attachments to hosting, with what happens on the other end.

Method What the recipient sees Scripts and images Account needed How long it lasts
Email attachment (Gmail web) Raw code in the preview; a page after download Work after download if all files are attached No As long as the email
Messaging app (WhatsApp, iMessage) A file to download or preview Depend on the phone's viewer No As long as the chat
Google Drive shared link Drive's file viewer or a download Not run as a page Google account to share Until you delete it
Dropbox shared link A download Not run as a page Dropbox account to share Until you delete it
CodePen The page plus the code, split into HTML, CSS and JS panels Work; local images need hosting Free account to save Until you delete it
GitHub Pages A web page at username.github.io Work GitHub account and a repository Until you delete it
Netlify Drop A web page, password-protected until claimed Work Netlify account within 1 hour Permanent after claiming
Tiiny Host A web page with a Tiiny Host banner on the free plan Work Free account While you sign in every 3 months
htmlkin A web page on its own subdomain Work None for 24 hours; free account after that While the page gets visits

Attachments and messengers deliver the file, so the recipient has to download it and open it in a browser on a computer. This is fine for a colleague who knows what an HTML file is and awkward for a client.

Cloud drives store the file and share it as a file. Since 2016 neither Google Drive nor Dropbox serves HTML as a page.

Code sandboxes such as CodePen show the page next to its source. They suit a developer who wants to read or change the code.

Static hosts serve the file as a page at a public address. This is the only group where the recipient clicks a link and sees exactly what you see.

Can you send an HTML file by email or WhatsApp?

Yes, you can send it, and the recipient will get a file. To see it as a page they need to download it and open it in a desktop browser. In Gmail on the web the preview shows code, which often reads as "the file is broken".

If you do send the file itself:

  1. Zip the folder when the page has CSS, scripts or images, so everything travels together.
  2. Tell the recipient what to do: unzip, then double-click index.html.
  3. Expect mobile trouble: phones open attachments in built-in viewers, and a page that depends on JavaScript may not work there.

A link avoids all three steps. Paste it in the email body or the chat, and it opens on any device with one tap.

try it yourself
The fastest way to publish an HTML project
No sign-up, no server setup. Your site opens at an address like hash.htmlkin.io.
Publish on htmlkin.io

What if the page has CSS, JavaScript or images?

Upload the whole folder or a ZIP with index.html at the root. The host keeps the folder structure, so style.css and images/logo.png load exactly as they do on your machine.

Before uploading, check three things:

  • Paths are relative. src="images/logo.png" works anywhere. src="C:\Users\anna\Desktop\site\logo.png" or file:///… works only on your computer.
  • The entry page is named index.html. On htmlkin the entry page is index.html in the root of the folder or archive; if there is none, the first HTML file in the root opens.
  • The archive has no extra top-level folder. Zip the contents of the site folder, so index.html sits at the top of the ZIP.

A site on htmlkin can hold up to 500 files. Pages that AI assistants generate are usually self-contained: CSS and JavaScript sit inside the single .html file, so you can upload that file as it is.

How to share an HTML file an AI made for you

Download the file from the chat and upload it to a host, or publish it straight from the chat. Three routes, from manual to fully automatic:

  1. Download and upload. Save the HTML that Claude, ChatGPT or Gemini produced, then drop it on the htmlkin home page. This works with any assistant.
  2. Publish from ChatGPT with one click. The htmlkin browser extension adds a "Publish to htmlkin.io" button to HTML code blocks and canvas on chatgpt.com. The public link goes straight to your clipboard. The extension popup also takes pasted HTML or an .html file on any tab.
  3. Let the assistant publish the page itself. Claude, Cursor and other MCP clients connect to the htmlkin MCP server and publish or update a site on request: "publish this report and give me the link". Setup is on the MCP documentation page; the MCP server and REST API work on every plan, including the free one.

More on this workflow: publish a site made with AI.

How to keep a shared page private or up to date

A public link opens for anyone who has it. Three settings cover the usual follow-up needs:

  • PIN protection. Viewers enter a 4-digit PIN before the page opens. Available on Pro and Business.
  • Updates at the same address. Upload a new version of the file, and the link you already sent shows the new content. Useful for a report that changes weekly.
  • A custom domain. Connect report.yourcompany.com with one DNS record; the SSL certificate is issued automatically. Available on every plan, including the free one.

Pro costs $9.99 a month and includes 10 sites, 1 GB of storage, PIN protection, QR codes and lead forms. The full comparison is on the pricing page.

FAQ

How do I send an HTML file as a link?

Upload the file to a static host such as htmlkin, Tiiny Host or Netlify Drop, copy the address it gives you and send that address. On htmlkin you drop the file on the home page and get a link like https://name.htmlkin.io without creating an account.

Can other people open HTML files?

Yes. Every desktop browser opens HTML files, so a recipient who downloads your file can double-click it. To open it as a page without downloading, they need a link to a hosted copy.

Can you share an HTML file via email?

You can attach it, but Gmail on the web previews HTML attachments as code, and the recipient has to download the file to see the page. Sending a link to a hosted copy works in every email client.

How do I share an HTML file on iPhone?

Upload the file from the Files app to a host in Safari, then share the link from Safari's share sheet. A link opens on any phone; an attached .html file opens in the phone's file viewer, where scripts may not run.

Is there a free way to share an HTML file as a link?

Yes. htmlkin gives a 24-hour link with no account and keeps one site online for free after sign-up. Tiiny Host's free plan hosts one site up to 3 MB with a banner. Netlify Drop and GitHub Pages are free with an account.

Key points

  • Send a link, and the recipient sees a web page. Send the file, and they see code or a download.
  • Google Drive and Dropbox stopped serving HTML as pages in 2016.
  • For a page with CSS, scripts or images, upload the whole folder or a ZIP with index.html at the root.
  • CodePen suits code review; a static host suits everyone else.

Drop your HTML file on htmlkin.io and get a link in about 10 seconds. For everything the hosting side covers, see HTML page hosting.

Sources

Ready to share your project?
An HTML site in 30 seconds. Keep it on a permanent subdomain — or just show it to a colleague right now.
Publish on htmlkin.ioHow it works