HTML to Base64
Paste HTML markup and get the Base64-encoded string in one click.
Last updated: May 29, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML to Base64?
HTML to Base64 encodes an HTML document or fragment as a Base64 string. Common uses include embedding HTML in a data URI for an iframe src, passing HTML through an API that only accepts Base64 payloads, or storing an HTML template as a Base64 value in a configuration file.
How to Use HTML to Base64
Paste your HTML into the input.
Click "Encode to Base64".
Toggle URL-safe if needed.
Copy the output.
Common Use Cases
- Embedding an HTML snippet in an iframe srcdoc or data URI: <iframe src="data:text/html;base64,...">.
- Sending HTML content through a webhook or API that requires Base64 encoding.
- Storing an email HTML template as a Base64 value in a database or config.
Example Input and Output
Encoding an HTML fragment to Base64.
<h1>Hello World</h1>PGgxPkhlbGxvIFdvcmxkPC9oMT4=Privacy
All encoding runs in your browser. No data is sent to any server.

