tools / base64-encoder
64
Base64 Encoder

Encode and decode Base64 strings. Supports text, URLs, and file upload.

Plain Text
📎
Drop a file or click to upload
Encode any file to Base64
Base64 Output

What Is Base64 Encoding?

Base64 encoding converts binary data (or any byte sequence) into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). This makes binary data safe to include in text-based formats like JSON, XML, HTML, HTTP headers, and email bodies, which may not support arbitrary binary bytes.

Why 64 Characters?

Base64 uses exactly 64 characters because 6 bits can represent 64 values (2⁶ = 64). Every 3 input bytes (24 bits) become 4 Base64 characters (4 × 6 bits). This produces a ~33% size increase — the trade-off for text-safe encoding.

URL-Safe Base64

Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 replaces them with - and _. Used in JWTs, OAuth tokens, and URL-embedded data.

Common Use Cases

Embedding images in CSS/HTML (data:image/png;base64,...), transmitting binary in JSON APIs, storing binary blobs in text databases, and encoding cryptographic keys and certificates (PEM format).

File Encoding

Drop any file onto the encoder to get its Base64 representation. Useful for embedding small images, fonts, or binary configuration files directly into source code or configuration without a separate file.