Base64 Encode
Base64 encode from text string/image/hex/binary:
Base64 decoder ►
URL encoder ►
Text to base64 encoding example
Text input:
The text input is first encoded as binary bit stream of ASCII codes of each character.
Each 6 bits of the bit stream are encoded to base64 digit.
Encoded base64 text string output:
Image to base64 encoding example
Image input:
Image data URI scheme with base64 encoded data output:
data:image/jpeg;base64,
is the data URI scheme header.
/9j/4AAQSkZ...
is the encoded base64 data.
HTML <img> with base64 data URI
<img src="data:image/jpeg;base64,/9j/4AAQSkZ...">
CSS background with base64 data URI
body {
background-image: url('data:image/jpeg;base64,/9j/4AAQSkZ...');
}
URL encoder ►
See also