Encode HTML To Base64

The converter helps to encode HyperText Markup Language (HTML) File to Base64 data then to copy or download the result data in several formats. If you want to decode, use Base64 to HTML Decoder.

How to encode HTML to Base64 Data

  1. Select or drag & drop one or several PDF files;
  2. Press Encode button (you will see the result below);
  3. Select output format (Plain Text, Data Url, HTML IFrame Tag);
  4. Copy or Download Base64 data;
  5. Done!

Output Formats

  • Plain Text - Only Base64 data;
  • Data Url - Base64 in data URL format (data:[<MIME-type>][;charset=<encoding>][;base64],<base64 data>)
  • HTML IFarme Tag - HTML Tag <iframe> with Data Url data in SRC property.

Output Format Examples for HTML

Plain Text:


Data Url:


HTML IFarme Tag:

<iframe src="data:text/html;base64,PGEgaHJlZj0iaHR0cHM6Ly9iYXNlNjQub25saW5lIj5CYXNlNjQuT25saW5lPC9hPg=="></iframe>

How to include base64 encoded HTML to my site (HTML page)

To include HTML in the website, you should encode HTML text and select the output format - HTML IFarme Tag. You will get results like this code:

<iframe src="data:text/html;base64,PGEgaHJlZj0iaHR0cHM6Ly9iYXNlNjQub25saW5lIj5CYXNlNjQuT25saW5lPC9hPg=="></iframe>

Copy and paste <iframe> tag to the <body> tag of your web page. You can set additional iframe tag attributes to width, height , and other - more info about iframe tag.