Base64 Encoder / Decoder

Encode and decode text using Base64 encoding for safe data transmission and storage

Base64 Encoding

Processing Mode

Base64 Decoding

Processing Mode

Understanding Base64

Learn about Base64 encoding and its applications

What is Base64?

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.

Encodes binary data into text format
Uses 64 characters (A-Z, a-z, 0-9, +, /)
Commonly used for email attachments and web data
Increases data size by ~33%
Safe for text-based protocols

How Base64 Works

📥
1. Input
Binary data as raw bytes
🔢
2. Group
Split into 24-bit chunks (3 bytes)
✂️
3. Divide
Convert to four 6-bit groups
🗺️
4. Map
6-bit values → Base64 indices
🔄
5. Convert
Indices → Base64 characters
6. Pad
Add = for incomplete groups

AaCharacter Table

A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63), = (padding)

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
0
1
2
3
4
5
6
7
8
9
+
/
=

Example: 'Man' → TWFu

1
Step 1: Text to Binary

Convert each character to its 8-bit ASCII binary representation

Technical
M = 77₁₀ = 01001101₂ a = 97₁₀ = 01100001₂ n = 110₁₀ = 01101110₂
Visual
M a n ↓ ↓ ↓ 01001101 01100001 01101110
2
Step 2: Group into 24-bit chunks

Combine three 8-bit bytes into one 24-bit group

Technical
01001101 01100001 01101110 → 010011010110000101101110
Visual
01001101 01100001 01101110 ↓ 010011010110000101101110
3
Step 3: Split into 6-bit groups

Divide the 24-bit chunk into four 6-bit groups

Technical
010011010110000101101110 → 010011 010110 000101 101110
Visual
010011|010110|000101|101110 ↓ ↓ ↓ ↓ 19 22 5 46
4
Step 4: Convert to decimal

Convert each 6-bit binary number to its decimal equivalent

Technical
010011₂ = 19₁₀ 010110₂ = 22₁₀ 000101₂ = 5₁₀ 101110₂ = 46₁₀
Visual
010011 → 19 010110 → 22 000101 → 5 101110 → 46
5
Step 5: Map to Base64 characters

Use the Base64 character table to find the character for each decimal value

Technical
19 → T (19th character) 22 → W (22nd character) 5 → F (5th character) 46 → u (46th character)
Visual
19 → T 22 → W 5 → F 46 → u
6
Step 6: Final result

Combine the Base64 characters to get the final encoded result

Technical
T + W + F + u = TWFu
Visual
T W F u ↓ TWFu

Common Use Cases

📧

Email Attachments

Encode binary files for email transmission

🌐

Web Development

Embed images and other assets directly in HTML/CSS

🔐

Data URLs

Create inline data representations for web resources

📱

Mobile Apps

Transfer binary data through text-based APIs

Advantages of Base64

🛡️

Data Integrity

Ensures data remains intact during transmission

🔄

Universal Compatibility

Works across different systems and platforms

📝

Text-Based

Can be read and edited in text editors

🔗

URL Safe

Can be used in URLs with proper encoding

Base64 FAQ

Frequently asked questions about Base64 encoding and decoding