HTML to Base64 & Base64 to HTML Converter

Encode HTML markup to Base64, a data URI, or an <iframe> tag, with a sandboxed preview. Runs in your browser; nothing is uploaded.

Sandboxed HTML previewScripts disabled (`sandbox=""`)
Enter HTML or decode Base64 above to preview the rendered markup safely.

How to encode HTML to Base64 and decode Base64 to HTML

  1. HTML to Base64: type, paste, or open an HTML document on the left and choose between a data:text/html;base64, Data URI, raw Base64, or a ready-to-embed <iframe src="data:text/html;base64,..."> tag.
  2. Base64 to HTML with sandboxed preview: paste Base64, a data:text/html;base64, URI, or an <iframe> snippet on the right to decode the markup and inspect it inside a script-disabled sandboxed preview frame.

Frequently asked questions

Why do browsers block pasting a data:text/html;base64,... URI into the address bar?
Modern browsers block top-level navigation to data:text/html URLs to prevent phishing attacks. However, embedding a data:text/html;base64,... URI inside an <iframe src="data:text/html;base64,..."> continues to work across browsers.
Is the live HTML preview safe when decoding untrusted Base64?
Yes. The preview uses <iframe sandbox="" srcdoc="..."> with an empty sandbox attribute, which strictly disables JavaScript execution, form submission, popups, and access to the parent page.
Does the HTML encoder preserve UTF-8 characters and emojis?
Yes. Markup is encoded as UTF-8 bytes before Base64 conversion, so non-ASCII text, symbols, and emojis round-trip without needing HTML entity escapes.