EncryptCodecencryptcodec
Tools/Base64

Base64 Encoder / Decoder

Encode and decode Base64 and Base64URL. Handles Unicode characters. Real-time as you type.

All processing happens in your browser — nothing is sent to our servers

Standard vs URL-Safe Base64

Standard Base64 uses +, /, and = padding. URL-Safe Base64 replaces these with - and _ and removes padding — safe for URLs, cookies, and JWT tokens.

How it works
Base64 Encode / Decode
Encode
01Input text

Text converted to UTF-8 bytes — any Unicode, including emoji and accented characters

026-bit groups

Every 3 bytes (24 bits) regrouped into four 6-bit values — a 3:4 byte-to-character expansion

03Alphabet map

Each 6-bit value (0–63) maps to A–Z, a–z, 0–9, then +/ (standard) or -_ (URL-safe)

04Padding

'=' appended if input isn't a multiple of 3 bytes — URL-safe Base64 typically omits padding

05ASCII output

Safe for HTTP headers, JSON, HTML, cookies, and URL query parameters

Decode
01Base64 string

Input validated — only A–Z, a–z, 0–9, +/, -_, and = characters are valid

02Strip padding

'=' padding removed; string length padded to a multiple of 4 if missing

03Reverse map

Each Base64 character converted back to its 6-bit value using the alphabet lookup table

04Regroup bits

Four 6-bit values packed back into three 8-bit bytes

05UTF-8 decode

Bytes interpreted as UTF-8 text — decoding fails if bytes are not valid UTF-8

Spec: RFC 4648 §4 (Base64), RFC 4648 §5 (Base64url)

Frequently Asked Questions

Keep learning

Encoding Chain
Chain encode/decode operations
Game
Decode Payload
Decode real-world encoded payloads
Game
Base64 Is Not Encryption
Common encoding vs encryption mistakes
Guide