Base64 Encoder & Decoder

Convert between plain text and Base64 encoded format. Ideal for encoding binary data, URL parameters, or working with APIs and web applications.

Enter any text you want to encode to Base64

URL-safe replaces + with - and / with _

Examples:

  • Hello World encoded in Base64 is SGVsbG8gV29ybGQ=
  • https://example.com encoded in Base64 is aHR0cHM6Ly9leGFtcGxlLmNvbQ==
  • User:Password for Basic Auth is VXNlcjpQYXNzd29yZA==
  • A URL-safe Base64 example: SGVsbG8_IEhvdyBhcmUgeW91Pw== becomes SGVsbG8_IEhvdyBhcmUgeW91Pw==

About Base64 Encoding

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses a set of 64 printable characters, which makes it ideal for transmitting data over media that are designed for text only.

Why Use Base64?

  • Data Transfer: Safely transport binary data in text-based protocols like email or HTTP
  • Embedding: Include binary data within JSON, XML, or HTML documents
  • URL Parameters: Use URL-safe Base64 for encoding data in URLs
  • Data Storage: Store binary data in text-based databases or document formats
  • Authentication: Used in Basic Authentication and JSON Web Tokens (JWT)

How Base64 Works

Base64 encoding converts every 3 bytes of binary data into 4 characters from a 64-character alphabet:

  • The standard alphabet includes A-Z, a-z, 0-9, + and /
  • URL-safe Base64 replaces + with - and / with _
  • The = character is used for padding when the input length is not divisible by 3
  • Every 6 bits of binary data is represented as one character

Common Applications

  • Web Development: Data URIs for embedding images in HTML/CSS, API authentication
  • Email Systems: MIME encoding for attachments
  • Cryptography: Encoding encryption keys, certificates, and signatures
  • Databases: Storing binary data in text fields
  • Configuration Files: Storing binary secrets in text-based config files
  • Blockchain: Encoding binary data in blockchain transactions

Important Considerations

  • Size Increase: Base64 encoding increases data size by approximately 33%
  • Not Encryption: Base64 is an encoding method, not encryption—it doesn't secure data
  • Charset Issues: Different Base64 implementations may handle non-ASCII characters differently
  • Line Length: Some applications limit Base64 line length to 76 characters for compatibility
  • Padding: The = characters at the end are padding and can sometimes be omitted in certain contexts

Our Base64 Encoder & Decoder tool makes it easy to convert between plain text and Base64 encoded format for all your development and data handling needs.