Base64 Encoder Decoder

Converts a string into Base64 encoding or decodes it back to its original form, in accordance with the RFC 4648 (Base64 Data Encoding specification).

Share this:

What is Base64 ?

Base64 is a method of encoding binary data, such as images or audio files, as ASCII text. It is often used for embedding small images in HTML, CSS, or JavaScript, or anything else that is part of a text file. The Base64 algorithm converts binary data into a 64-printable character subset of ASCII, which can be easily transmitted in environments that are designed to handle only ASCII, such as email. It is also used for data encryption and decoding of multimedia files.

Base64 is used in a variety of contexts, some of the most common include:

  • Embedding small images in HTML, CSS, or JavaScript, where the image data is encoded as a Base64 string and included in the text file.
  • Encrypting or encoding sensitive data, such as passwords or authentication tokens, so that it can be transmitted over a network or stored in a text file without the risk of being intercepted.
  • Encoding binary files, such as images or audio files, so that they can be sent as email attachments. Storing binary data in databases or other data stores that only support text data.
  • Handling binary data in web services or APIs that only support text data.
  • Various other places where the ability to represent binary data in an ASCII string format is useful.

It's worth noting that Base64 is a way of representing binary data using only printable characters from the ASCII table which is a widely used encoding technique.

Example

Why did the math book look sad? Because it had too many problems!

Text above can be encoded in Base64 into:

V2h5IGRpZCB0aGUgbWF0aCBib29rIGxvb2sgc2FkPyBCZWNhdXNlIGl0IGhhZCB0b28gbWFueSBwcm9ibGVtcyE=