What is the Base64 Encode / Decode?
The Base64 Encode / Decode utility converts plain text, authorization credentials, and arbitrary data strings into standard Base64 representation (RFC 4648) and decodes Base64 strings back into original human-readable text. It features full UTF-8 character encoding support, ensuring international accented letters and emojis do not get corrupted.
Base64 is a binary-to-text encoding scheme designed to transmit binary data over communication channels that are fundamentally textual (such as email via MIME, HTTP Basic Authentication headers, data URIs for inline images, and cryptographic signatures). By converting 8-bit bytes into a safe 64-character ASCII set, it guarantees data integrity during transmission.
How to Use the Base64 Encode / Decode
- Select Mode: Choose either Encode (Text → Base64) or Decode (Base64 → Text).
- Enter Content: Type or paste your data into the input workspace.
- Live Translation: The output automatically renders in real time as you type.
- Copy or Clear: Copy your encoded or decoded string with one click.
Formula & How It Works
Base64 maps groups of 24 bits (3 bytes) into 4 six-bit digits drawn from a 64-character alphabet:
Alphabet:
A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63)
Padding: = (used when input length is not a multiple of 3)
Encoding Formula:
1. Group every 3 bytes (3 * 8 = 24 bits).
2. Split into 4 chunks of 6 bits each.
3. Map each 6-bit index (0 to 63) to the Base64 alphabet.
4. If 1 byte remains, pad with '=='. If 2 bytes remain, pad with '='.Worked Example: Input string "Man". ASCII codes: 77, 97, 110. Binary: 01001101 01100001 01101110. Regroup into four 6-bit chunks: 010011 (19='T'), 010110 (22='W'), 000101 (5='F'), 101110 (46='u'). Base64: TWFu.
Practical Worked Examples
| Plain Text Input | Base64 Encoded Output | Padding Note |
|---|---|---|
| "ToolsLand" | VG9vbHNMYW5k | No padding needed (9 bytes = multiple of 3) |
| "Hello World" | SGVsbG8gV29ybGQ= | Single '=' padding (11 bytes) |
| "admin:secret" | YWRtaW46c2VjcmV0 | HTTP Basic Auth format |
Common Everyday & Professional Use Cases
Constructing HTTP Basic Authentication headers, generating data URIs for embedding small images directly into CSS, decoding JWT token headers and payloads, and safely transmitting binary hashes via email.