Base64 Encoder & Decoder

Encode text or files to Base64, or decode Base64 back to text or a downloadable file. Drag-and-drop support and URL-safe mode.

All encoding and decoding happens locally in your browser. Your files and text never leave your device.

Or drag a file to encode

Any file type · up to ~100 MB

—

How Base64 Works

Base64 converts 3 bytes (24 bits) into 4 printable characters. This adds ~33% size overhead, but guarantees the output survives any text-only channel.

Character Set
Standard Base64: A–Z, a–z, 0–9, +, / (64 chars) and = for padding. URL-safe: replaces + → - and / → _.
Encoding Flow
3 input bytes → 4 6-bit groups → 4 Base64 chars. If input length not divisible by 3, trailing = pads the output.
Browser API
Modern browsers provide btoa()/atob() for ASCII-only Base64. For UTF-8 and binary files we use TextEncoder/TextDecoder with Uint8Array handling.

Size Overhead Reference

Input SizeBase64 OutputOverhead
1 KB~1.33 KB+33%
10 KB~13.3 KB+33%
100 KB~133 KB+33%
1 MB~1.33 MB+33%

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using only 64 ASCII characters (A-Z, a-z, 0-9, +, /). It's commonly used to safely transmit binary data over text-only protocols like email or JSON.

Is Base64 encryption?

No. Base64 is encoding, not encryption. It's fully reversible with no key. Anyone can decode Base64. If you need security, you need actual encryption (AES, RSA, etc.).

What is URL-safe Base64?

Standard Base64 uses + and / characters which are not URL-safe. URL-safe Base64 replaces + with - and / with _. Padding (=) is often omitted. This makes it safe to embed in URLs, query parameters, and file names.

Can I encode files larger than my browser's memory?

This tool loads the entire file into memory for encoding. For files over ~100 MB you may see performance issues. For production use, consider streaming-based encoders.

Does this tool support data URIs?

Yes. When decoding, the tool detects data URI prefixes (like data:image/png;base64,...) and automatically extracts the Base64 portion. It also shows you the detected MIME type so you know what kind of file it represents.

When you need the reverse direction, rebuild a picture from its encoded text with Base64 to Image, or see exactly how much the encoding inflates your payload with the Data Size Converter.