Base64 Encode

    Switch to Base64 Decode

 

About Base64 Encode

Base64 encoding is a method used to encode binary data into ASCII characters. It works by taking groups of three bytes (24 bits) from the binary data and converting them into four ASCII characters. Each character represents 6 bits of the original binary data.

Here's how Base64 encoding typically works:

  • Divide the binary data into groups of three bytes (24 bits).
  • Convert each group of 24 bits into four 6-bit numbers.
  • Map each 6-bit number to its corresponding character in the Base64 alphabet. The Base64 alphabet usually consists of 64 characters, which include uppercase and lowercase letters, digits, and two additional characters (commonly '+' and '/').
  • If the binary data is not divisible evenly by three, padding characters ('=') are added to make the length of the encoded data a multiple of four.

For example, consider the binary data "01000001 01000010 01000011". When encoded in Base64, it becomes "QUJD", where each character represents six bits of the original data.

Base64 encoding is commonly used in various applications, such as encoding binary attachments in emails, transmitting binary data over text-based protocols like HTTP, embedding binary data in XML or JSON, and more. It is important to note that Base64 encoding increases the size of the data by approximately 33% due to the overhead of encoding binary data into ASCII characters.