Base64 Encoder

The Base64 Encoder converts text or binary data into Base64 encoding. Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used to encode email attachments, embed images in HTML/CSS, transmit binary data over text-based protocols, and store binary data in JSON or XML. The encoder takes any text input and produces a Base64 string that can be safely transmitted over channels that only support text.

Formula

Base64 encoding:
1. Convert input to binary
2. Group into 6-bit chunks
3. Map each 6-bit value to a character:
   A-Z, a-z, 0-9, +, /
4. Pad with = if needed

Output: ASCII string, 33% larger than input

Example

Input: Hello World Output: SGVsbG8gV29ybGQ= Input: Calczy Output: Q2FsY3p5

How to Use

  1. Enter or paste your text into the input field
  2. Click encode to convert to Base64
  3. The output shows the Base64 string
  4. Copy the encoded string
  5. Use it in data URIs, API calls, or configuration files

Frequently Asked Questions

What is Base64 used for?

Base64 is used to encode binary data (images, files, certificates) into text format for transmission over text-based protocols like email (MIME), HTTP, JSON, and XML. It is also used to embed images directly in HTML or CSS via data URIs.

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode Base64. It provides no security. Use AES or RSA for encryption. Base64 is for data representation, not confidentiality.

How much larger is Base64 output?

Base64 output is approximately 33% larger than the input. Every 3 bytes of input becomes 4 bytes of Base64. This overhead is the trade-off for text-safe representation.

Can Base64 encode Unicode text?

Yes, but the text is first converted to UTF-8 bytes, then encoded to Base64. For example, the emoji 😀 (UTF-8: F0 9F 98 80) becomes 8J+YgA== in Base64.

What characters does Base64 use?

Standard Base64 uses A-Z, a-z, 0-9, +, and /. URL-safe Base64 replaces + with - and / with _ to avoid URL encoding issues. Padding (=) is added at the end if needed.