L
logixwire

Base64 Encoder / Decoder

Encode text or files to Base64, or decode Base64 back to text. Supports UTF-8, ASCII, ISO-8859-1, image preview, and file upload.

This looks like Base64 encoded data
Input
Output
Input: 0 chars · Output: 0 chars · Ratio: —

How Base64 Encoding Works

Base64 converts binary data into a text-safe format using 64 printable ASCII characters.

What Is Base64?

Base64 encoding converts binary data (bytes) into a sequence of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used for transmitting data over media designed to handle text, such as email attachments (MIME), data URIs in HTML/CSS, and JSON APIs. The encoded output is approximately 33% larger than the original input.

Frequently Asked Questions

Common questions about Base64 encoding and decoding.

Base64 is used to encode binary data (images, files, binary payloads) into a text-safe format for transmission over text-based protocols like HTTP, SMTP, and JSON. Common uses include data URIs in HTML, email attachments (MIME), and API data transfer.

Base64 encodes every 3 bytes of input into 4 ASCII characters. Since each character represents 6 bits (2^6 = 64), 4 characters carry 24 bits = 3 bytes. This 4:3 ratio means the output is always 4/3 times the input size, a 33% increase. Padding (=) may add extra characters to align the final group.

Standard Base64 uses '+' and '/' characters, which have special meanings in URLs. URL-safe Base64 replaces '+' with '-' and '/' with '_', and removes padding '=' characters. This variant is used in JWT tokens, YouTube video IDs, and other URL-embedded encoded data.

Yes, most Base64 decoders can handle missing padding characters. The padding (= or ==) is only needed to make the encoded length a multiple of 4. When decoding, the padding can be safely re-added. However, strict decoders may reject unpadded input unless URL-safe mode is used.