A virtual teacher who reveals to you the great secrets of Base64

HTML to Base64

This online converter allows you to encode HTML to Base64. Although this is an unusual use of the Base64, some developers use it and hope that this converter does exactly what you need. If you are looking for examples of how to embed Base64 encoded data into web pages, please check the following pages: Data URI and HTML.

How to convert HTML to Base64

  1. Type or paste your HTML into the “HTML” field.
  2. If necessary, select the desired output format.
  3. Press the “Encode HTML to Base64” button.
  4. Download or copy the result from the “Base64” field.

Output formats

If you do not know what output format you need, check the following examples to see how will look the result of the same Base64-encoded HTML formatted in each of the available formats:

Plain text:
Data URI:
HTML Hyperlink:
<a href="data:text/html;base64,V2VsY29tZSB0byA8Yj5iYXNlNjQuZ3VydTwvYj4h"></a>
HTML Iframe:
<iframe src="data:text/html;base64,V2VsY29tZSB0byA8Yj5iYXNlNjQuZ3VydTwvYj4h">
  The “iframe” tag is not supported by your browser.
JavaScript Popup:
window.onclick = function () {

If I missed an important output format for Base64-encoded HTML strings, please let me know — I would love to implement it.

Comments (3)

I hope you enjoy this discussion. In any case, I ask you to join it.

  • Juliet,
    I registered for ETH and since then I have been having issue with my account like I don't have an ID, my level has expired
  • sapan,
    please help me for converting html tag to base64 in javascript
  • Dale,
    This was in my cell phone
Add new comment

If you have any questions, remarks, need help, or just like this page, please feel free to let me know by leaving a comment using the form bellow.
I will be happy to read every comment and, if necessary, I will do my best to respond as quickly as possible. Of course, spammers are welcome only as readers.