How to Share an HTML File From VS Code (Without Setting Up a Server)

November 4, 2026 · 4 min read

Share a page as a link in secondsUpload HTML or a PDF, get a link + QR code. Free, no sign-up.
Create a free link

You built an HTML page in VS Code and it looks right on your screen. Now you want a friend, a client or a teacher to see it. The fastest way is to put the finished file online and send a link, because a link opens in any browser while a .html attachment often does not.

This guide shows why the usual "Live Server" button does not solve this, and three ways to share the page.

Why Live Server is not enough

Live Server is a popular VS Code extension. Its own page describes it as a local development server with live reload, and it lists connecting from a phone over your Wi-Fi as a feature. That is great while you are building.

But it is a development tool, not a publishing tool. The page lives on your computer. When you close VS Code or shut your laptop, the page is gone for everyone else. And a localhost link only means something on your own machine, so sending it to a client does nothing.

So the real question is: how do I put one finished file online for a short time, with as little setup as possible?

Before you share: make it one file

Most sharing tools take a single HTML file. If your page links to separate style.css, script.js or image files, those links break once the file leaves your folder.

Fix it in two minutes:

  1. Paste your CSS into a <style> tag in the <head>.
  2. Paste your JavaScript into a <script> tag before </body>.
  3. Use full https:// links for images that are already online, or embed small images as base64 data.
  4. Open the file straight from your folder (double-click it) and check it still looks right.

If the page works when opened on its own, it will work as a link.

Option 1: Upload the file and get a link (fastest)

For a quick share, use a tool that turns a file into a link.

  1. Save the file in VS Code (Ctrl+S, or Cmd+S on Mac).
  2. Open DropMyPage and choose Upload file, then pick your .html file. You can also select all the code in VS Code, copy it, and use Paste HTML.
  3. Tap Create link. You get a short link and a QR code.
  4. Send the link on WhatsApp, email or chat.

On the free plan you do not need an account, files can be up to 5 MB and the link works for 7 days. After that it expires. If you need the link to stay up, the paid plans keep it permanently.

Before sending, you can preview your code in the HTML viewer to catch mistakes.

Option 2: A static host for pages that should stay online

If it is a real website, or you want it online for months, use a static hosting service. GitHub Pages, Netlify and Cloudflare Pages are common choices. They are built for multi-file sites, so you do not need to merge your CSS and JavaScript. The trade-off is setup: an account, a repository or a deploy step, and sometimes a build setting. Check each service's own site for its current free limits.

Option 3: Send the file itself

You can attach the .html file to an email or a chat, but it often fails. Email services may block or strip HTML attachments, and on phones the file may open as plain text or not open at all. If the person is on a laptop and knows how to double-click a file, it can work. For everyone else, a link is safer. See How to open an HTML file on Android or iPhone for why phones struggle.

Which one should you pick?

Situation Best choice
Quick look at a finished page, one file Upload and share a link
A site that should stay online for months Static host
Sending to a tech-savvy person on a laptop Attach the file
Sharing on WhatsApp A link (how to send an HTML page on WhatsApp)

Common problems

FAQ

Can I share a localhost link from Live Server?

No. A localhost address only works on your own computer. Other people cannot open it, so you need to put the file online first.

Do I need to create an account?

Not for a quick free link on DropMyPage. A static host will ask you to sign up.

Is a shared link private?

A link works for anyone who has it, so do not share anything private. The Pro plan on DropMyPage lets you set a password on a page.

Can I update the page after sharing?

Replacing the page and keeping the same link is a Pro feature on DropMyPage. On the free plan, upload the new version and send the new link.

Try DropMyPageFree links, QR codes, WhatsApp sharing and templates.
Create a free link

More from the blog