Base64 Encoder/Decoder

Convert text to Base64 encoding or decode Base64 back to text. A useful tool for developers working with data encoding.

Input

0 characters

Options

No file chosen

Result

About Base64 Encoding

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format by translating it into a radix-64 representation.

Base64 encoding is commonly used when binary data needs to be stored or transferred as text. Common use cases include:

  • Email Attachments: MIME format uses Base64 to encode binary attachments.
  • Data URIs: Embedding images or other binary data directly in HTML or CSS.
  • API Communication: Sending binary data in JSON payloads.
  • Storing Binary Data: When binary data needs to be stored in text-based storage systems.
  • Avoiding Special Character Issues: When data might contain characters that could be problematic in certain contexts.

Base64 encoding works by:

  1. Taking 3 bytes (24 bits) of binary data
  2. Dividing those 24 bits into 4 groups of 6 bits each
  3. Converting each 6-bit value (0-63) to a character from the Base64 alphabet

The standard Base64 alphabet consists of:

  • A-Z (26 characters)
  • a-z (26 characters)
  • 0-9 (10 characters)
  • + and / (2 characters)

When the input length is not divisible by 3, padding with = characters is used.

URL-safe Base64 replaces + with - and / with _ to avoid issues with URL encoding.

Your Privacy: All processing happens locally in your browser. Your text and files are never sent to any server.