Encode HTML To Base64

The converter helps to encode HyperText Markup Language (HTML) File to Base64 data then to copy or download a result data in several formats. If you want 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 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)

If you want to inclide HTML to web site, you should encode HTML text and select output format - HTML IFarme Tag. You will get result like this code:

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

Copy & Paste <iframe> tag to <body> tag of your web page. You can set addition iframe tag's attributes are width, height and other. More info about iframe tag.