HTML to Base64
Paste HTML markup and convert it to Base64 or to a data:text/html;base64, URI. A Base64 HTML document can be displayed in an iframe or opened as a link without any server.
How to convert HTML to Base64 online
- Paste your HTML.
- Choose the output format.
- Click Encode HTML to Base64.
Output formats
Choose how the result should be wrapped. The converter can return:
- txt: only the Base64 string, ready to paste into code, a database field or an API request.
- uri: a complete
data:URI that you can paste in a browser address bar or use anywhere a URL is accepted. - html iframe: an
<iframe>that renders the content inline. - html hyperlink: an
<a>link that downloads or opens the embedded file. - javascript popup: JavaScript that opens the content in a new window.
Browser restrictions
For security reasons, modern browsers block top-level navigation to data:text/html URLs typed by scripts. Embedding them in an <iframe> still works.
Frequently asked questions
How do I display Base64 HTML?
Use <iframe src="data:text/html;base64,..."></iframe>.
Comments (0)
Questions, ideas or a bug in “HTML to Base64”? Leave a comment, rate the tool, or reply to others.
No comments yet. Be the first to share your feedback!