UNITMONKEY

Base64 Converter

Encode text to Base64 or decode Base64 to text


Understanding Base64 Encoding

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with text.

What is Base64?

Base64 encoding converts binary data into a set of 64 characters (A-Z, a-z, 0-9, + and /) that can be safely transmitted over text-based protocols. The encoding process takes 3 bytes of binary data and represents them as 4 ASCII characters. If the input data length is not divisible by 3, padding characters (=) are added to the output.

Common Uses of Base64

  • Embedding binary data in HTML or CSS (e.g., small images)
  • Encoding email attachments (MIME)
  • Storing complex data in JSON
  • Transmitting binary data over text-only protocols
  • Encoding binary data in URLs

Base64 Variants

Several variants of Base64 exist for specific applications:

  • Standard Base64 (RFC 4648) - Uses A-Z, a-z, 0-9, +, /
  • URL-safe Base64 - Uses A-Z, a-z, 0-9, -, _ (replacing + and /)
  • MIME Base64 - Limits line length to 76 characters