HTML to data URL

How it worksA data URL packs the whole page into the address itself: data:text/html;base64,PCFET0… It needs no server, but most browsers block opening one from a clicked link, so it is useful for testing and embedding, not for sharing.
data URL

Runs entirely in your browser — nothing you type here is uploaded.

Where data URLs work

  • Pasted into the address bar — the page renders (handy for quick tests).
  • Inside an iframe — <iframe src="data:text/html;base64,…"> works in all modern browsers.
  • Images and fonts — data:image/png;base64,… is a common way to inline small assets.

Where they fail

Chrome and Edge (since 2017) and Firefox (since 2018) block top-level navigation to data: URLs started by a link or script, because the trick was widely used for phishing. So a data URL sent in a chat or email will not open when tapped. They also get long fast: Base64 adds about a third to the size, and many chat apps cut messages or refuse URLs over a few thousand characters.

For anything you want other people to open, a hosted link — https://name.htmltolink.dev/ — is short, opens everywhere, and can be updated later.

Questions

Base64 or percent-encoding?
Base64 is predictable and safe for any characters. Percent-encoding is shorter for mostly-ASCII HTML but harder to read.
Is a data URL private?
The content travels inside the URL, so anyone who sees the URL sees the page — and URLs end up in histories and logs.
Can I share a data URL as a QR code?
Phones will not open data URLs from a scan. Convert to a hosted link and use its QR code.