Skip to content
Start here

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

Why emailing an .html file or dropping it in Drive usually ends with "it just shows code", and the ways to share HTML that open correctly on any device.

7 min readUpdated October 2026By the HTMLtoLink team
Short answer

The reliable way to share an HTML file is to send a link, not the file. Upload it to an HTML host such as HTMLtoLink and share the URL: it opens as a working page in any browser on any phone or computer. Email attachments are often blocked or opened as text, and Google Drive and Dropbox no longer render HTML.

Why sending the .html file itself goes wrong

  • Email security filters. HTML attachments are one of the most common phishing vectors, so many corporate and school mail systems quarantine, strip or warn about them. Your recipient may never see the file.
  • Phones do not open it nicely. On a phone, tapping an .html attachment often shows a download prompt, a plain-text view, or an app picker. Few people get as far as a rendered page.
  • Separate files get left behind. If the page uses style.css, script.js or an images/ folder, sending only the HTML delivers an unstyled, broken page.
  • Cloud drives show source code. Google Drive stopped hosting web pages in 2016 and Dropbox stopped rendering HTML in 2017; both now preview the code or offer a download.
  • No updates. Once a file is sent you cannot fix a typo. Everyone keeps their old copy.
  1. Open HTMLtoLink.
  2. Paste the code, or upload the .html file — or the whole folder if it has other files.
  3. Optionally choose an address and a password.
  4. Copy the link into your email, chat, LMS or slide. On a phone, use Share.

The recipient taps the link and sees the page — same on iPhone, Android, Windows, Mac and Chromebook, with no download and no app. If you spot a mistake later, update it at the same URL; everyone sees the new version.

Turn your HTML into a link now
Paste code or drop a file, ZIP or folder. Free plan with Google sign-in, custom address & password.
Get a link

If you really must send the file

Sometimes a link is not allowed — an exam submission portal, an offline kiosk. Then:

  • Make it a single file so nothing can get separated: inline the CSS and JS with the combiner and embed images with image to Base64.
  • Zip it before attaching; ZIPs pass more filters than raw .html files and keep folders together.
  • Tell the recipient how to open it: download, then open with Chrome, Safari, Edge or Firefox.

When you paste a link into WhatsApp, Slack or LinkedIn, the preview card comes from your page's title, description and Open Graph tags. Add them before you publish with the meta tag generator.

Questions people ask

Why does my HTML file open as code?

The app or website you opened it in is showing the file's text rather than rendering it. Google Drive, Dropbox, many email apps and file viewers do this. Open it in a browser, or share a hosted link instead.

Can I share an HTML file on WhatsApp?

You can send the file, but most recipients cannot open it properly on their phone. Send a link to the hosted page instead — WhatsApp shows a preview card and it opens in one tap.

How do I share an HTML file privately?

Publish it with a password on HTMLtoLink and send the password separately. The page is also noindex, so it never appears in search results.

Read next

Your HTML deserves a real link

Paste code, drop a file, a ZIP or a whole folder — get a live URL with your own address, an optional password and a QR code. Free to start with Google sign-in; paid plans keep links online for good.

Turn HTML into a link