Base64 Converter

Encode and decode Base64 strings. Supports UTF-8 safe encoding/decoding for international text. Perfect for data transmission and storage.

Enter text to encode or Base64 string to decode
Enter text to encode to Base64, or paste a Base64 string to decode.

Result


                    

Understanding Base64 Encoding

What is Base64?

Base64 is an encoding scheme that converts binary data into ASCII text format using 64 printable characters: A-Z, a-z, 0-9, +, and /. The equals sign (=) is used for padding. It allows binary data to be safely transmitted over text-based protocols that were designed to handle only text. Base64 increases data size by approximately 33%, but ensures compatibility across different systems and protocols.

Character set: A-Z, a-z, 0-9, +, / (64 characters total)

Example: "Hello" encodes to "SGVsbG8="

How Base64 Works

Base64 encoding works by taking three bytes (24 bits) of input data and dividing them into four 6-bit groups. Each 6-bit group represents a number from 0 to 63, which maps to one of the 64 Base64 characters. When the input isn't divisible by 3, padding characters (=) are added to the end. This process makes binary data representable using only printable ASCII characters.

Process: 3 bytes (24 bits) → 4 Base64 characters (24 bits in 6-bit groups)

Efficiency: Output is ~33% larger than input (4/3 ratio)

Common Uses of Base64

Base64 is widely used in web development and data transmission. Email attachments use Base64 (MIME encoding) to send binary files through text-based email protocols. Data URIs in HTML/CSS embed images directly in code using Base64. APIs use it to transmit binary data in JSON. It's also used for encoding credentials in HTTP Basic Authentication, storing binary data in XML/JSON, and transmitting encrypted data.

Applications: Email attachments, data URIs, API tokens, image embedding, authentication

Protocols: HTTP, SMTP, JSON, XML, MIME

Base64 vs Other Encodings

Base64 differs from encryption (it's encoding, not encryption - anyone can decode it). Unlike hexadecimal encoding which uses only 0-9 and A-F, Base64 uses 64 characters for more efficient encoding. URL-safe Base64 variants replace + and / with - and _ to avoid URL encoding issues. Base64 is simpler than more complex encodings like Base85 or Base91, making it the industry standard for most applications.

Not encryption: Base64 is easily reversible - it's encoding, not security

Variants: Standard Base64, URL-safe Base64, MIME Base64

UTF-8 and Base64

When encoding text to Base64, the text is first converted to UTF-8 bytes, then those bytes are encoded to Base64. This ensures that international characters, emojis, and special symbols are properly preserved. When decoding, the Base64 is converted to bytes, then those bytes are interpreted as UTF-8 text. This two-step process allows Base64 to handle any text in any language safely.

Process: Text → UTF-8 bytes → Base64 encoding

Support: All languages, emojis, special characters

Base64 Quick Reference

Common Examples:

  • "Hello" → SGVsbG8=
  • "World!" → V29ybGQh
  • "Base64" → QmFzZTY0
  • "123" → MTIz

Key Points:

  • Uses 64 printable characters
  • Output ~33% larger than input
  • = used for padding
  • Case-sensitive encoding

Special Characters:

  • + Plus sign (index 62)
  • / Forward slash (index 63)
  • = Padding (multiple)
  • No = Exact multiple of 3 bytes