Base64 Encode and Decode
Convert text or files to Base64 and back. Pick the character set, wrap lines for email, or make the output URL-safe.
How the first 3 bytes become 4 characters
Base64 reads the bytes as one stream of bits and cuts it into 6-bit groups. Each group is a number from 0 to 63, which picks a character from the alphabet. Colors show which byte each bit came from.
H0x48 · 72
e0x65 · 101
l0x6C · 108
0
1
0
0
1
0
0
0
0
1
1
0
0
1
0
1
0
1
1
0
1
1
0
0
S18
G6
V21
s44
Alphabet
A–Z a–z 0–9 + /Size 4 chars per 3 bytes (+33%)Padding = fills the last groupSpec RFC 4648, MIME line wrap RFC 2045Encode a file
Turn an image, PDF or any other file into Base64, for example to embed it in CSS, HTML or a JSON payload. Files up to 50 MB. Nothing leaves your browser.
Every tool runs in your browser. Nothing you type or upload is sent to a server.