Convert text to Base64 or decode Base64 back to text or binary files.
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used when there's a need to encode binary data that needs to be stored and transferred over media that are designed to deal with text.
Common uses of Base64 encoding include:
Base64 encoding increases the data size by approximately 33% (4 characters per 3 bytes of data), but ensures that the data remains intact without modification during transport.
Base64 encoded message:
SGVsbG8sIHRoaXMgaXMgYSBzZWNyZXQgbWVzc2FnZSE=
Decoded: "Hello, this is a secret message!"
Base64 encoded ASCII art:
ICAgICAgXl9eICAgICAgICAgICAgICAgIA0KICAgICAoby5vKSAgICAgICAgICAgICAgIA0KICAgICAoXykpXyAgICAgICAgICAgICAgIA0KICAgICAgIiAiICAgICAgICAgICAgICAgIA==
Decodes to a cute ASCII bunny!
Small image as a data URL:
This is a tiny red dot image embedded directly in the page!
Base64 encoded emoji:
8J+Ygg==
Decodes to: "😂" (Face with Tears of Joy emoji)
Web developers use Base64 to embed small images directly in CSS:
.icon { background-image: url(data:image/png;base64,iVBORw0KGg...); }
JSON Web Tokens use Base64 encoding for their three parts:
eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U
MIME uses Base64 to encode binary attachments in emails:
Content-Type: image/png
Content-Transfer-Encoding: base64
iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAA...
Base64 uses 64 different characters: A-Z, a-z, 0-9, + and / (with = for padding). That's 2^6 characters, hence "64"!
Base64 encoding was first standardized in 1987 as part of RFC 989 for privacy-enhanced mail.
There's a URL-safe version of Base64 that uses - and _ instead of + and / to avoid URL encoding issues.
Base64 encoding increases data size by about 33% because it uses 4 ASCII characters to represent 3 bytes of binary data.
Base64 is encoding, not encryption. It provides no security and is easily reversible!
The = character at the end of Base64 strings is padding to ensure the length is a multiple of 4 characters.