onetooltorule.it

Back to tools

Base64 Encoder/Decoder

Convert text to Base64 or decode Base64 back to text or binary files.

Encode to Base64

About Base64

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:

  • Embedding image data in HTML or CSS
  • Encoding email attachments (MIME)
  • Storing complex data in JSON
  • Transferring data in URL parameters

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.

Fun Base64 Examples

Hidden Messages

Base64 encoded message:

SGVsbG8sIHRoaXMgaXMgYSBzZWNyZXQgbWVzc2FnZSE=

Decoded: "Hello, this is a secret message!"

ASCII Art

Base64 encoded ASCII art:

ICAgICAgXl9eICAgICAgICAgICAgICAgIA0KICAgICAoby5vKSAgICAgICAgICAgICAgIA0KICAgICAoXykpXyAgICAgICAgICAgICAgIA0KICAgICAgIiAiICAgICAgICAgICAgICAgIA==

Decodes to a cute ASCII bunny!

Data URLs

Small image as a data URL:

Tiny red dot

This is a tiny red dot image embedded directly in the page!

Emoji Encoding

Base64 encoded emoji:

8J+Ygg==

Decodes to: "😂" (Face with Tears of Joy emoji)

Base64 in the Wild

CSS Background Images

Web developers use Base64 to embed small images directly in CSS:

.icon { background-image: url(data:image/png;base64,iVBORw0KGg...); }

JWT Tokens

JSON Web Tokens use Base64 encoding for their three parts:

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U

Email Attachments

MIME uses Base64 to encode binary attachments in emails:

Content-Type: image/png
Content-Transfer-Encoding: base64

iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAA...

Base64 Trivia

Why "64"?

Base64 uses 64 different characters: A-Z, a-z, 0-9, + and / (with = for padding). That's 2^6 characters, hence "64"!

Invented When?

Base64 encoding was first standardized in 1987 as part of RFC 989 for privacy-enhanced mail.

URL-Safe Variant

There's a URL-safe version of Base64 that uses - and _ instead of + and / to avoid URL encoding issues.

Size Increase

Base64 encoding increases data size by about 33% because it uses 4 ASCII characters to represent 3 bytes of binary data.

Not Encryption!

Base64 is encoding, not encryption. It provides no security and is easily reversible!

Padding Character

The = character at the end of Base64 strings is padding to ensure the length is a multiple of 4 characters.