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 (17)

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
  • Kingnero,
    I just encoded my html file now but I couldn't view it on my browser. I actually did this:

    <script src="data:text/html;base64,PGh0bWw+DQo8aGVhZD4NCjx0aXRsZT5BZG9iZSBEb2N1bWVudCB8I"></script>

    and save the file but i couldn't view it in browser
    • Administrator,
      The script element is used to "include" JavaScript code, while for your case you have to use iframe.
  • Noah,
    I sold a nft and did not get any money where is my money
    • thanos,
      Gone. Reduced to Atoms.
  • Rajneesh,
    Not many more than you
  • web3cc,
    thanks.. Nice simple efficient site without all the B.S..just nutty gritty nuts n bolts... Good to see
    Thank you
    base64.guru ✅

  • Felix,
    Love It :D
  • tomy,
    Yes many more than you
  • nqhXncMU,
    -1' OR 2+114-114-1=0+0+0+1 or 'OcRFOC1z'='
  • nqhXncMU,
  • nqhXncMU,
  • nqhXncMU,
  • nqhXncMU,
    -5 OR 673=(SELECT 673 FROM PG_SLEEP(15))--
  • User,
    Вот делаю странички в data:text/html;base64, и data:txt/html;base64, на HTML, этот сайт использую постоянно, хорошая штука.
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.