← All tools
// Encoding

Base64 Encoder / Decoder online

Encode text or files to Base64, decode Base64 strings — runs in your browser

Chunky Munster mascot
by
CHUNKY
MUNSTER
// Output
Output will appear here...
0
Input chars
0
Output chars
Size ratio

Base64 encoding converts binary data into a text format using 64 printable ASCII characters. It is one of the most fundamental encoding schemes in computing, used everywhere from email attachments (MIME) to embedding images in CSS and HTML data URIs, to encoding data in JWTs and cookies.

What is Base64 and How Does It Work Online?

Base64 works by taking three bytes of binary data (24 bits) and splitting them into four groups of six bits each. Each 6-bit group is then mapped to one of 64 printable characters (A–Z, a–z, 0–9, +, /). If the input isn't divisible by three, padding characters (=) are added. The result is roughly 33% larger than the original but is safe to transmit over text-based protocols.

Common Use Cases

When Should You Use Base64 Encoding?

Base64 is the right choice whenever you need to transmit binary data — images, files, cryptographic keys, certificates — through a channel that was designed to carry text. Common scenarios include:

Base64 vs. Base64URL — What's the Difference?

Standard Base64 uses the characters A–Z, a–z, 0–9, +, and / with = padding. The + and / characters are not URL-safe — they have special meaning in URLs. Base64URL replaces + with - and / with _ and omits the padding, making it safe to use in URLs and HTTP headers without percent-encoding. JWTs, for example, always use Base64URL encoding.

Is Base64 Encryption?

No. Base64 is encoding, not encryption. Anyone who can see the Base64 string can decode it instantly — there is no key, no secret, and no security. If you need to protect data, use actual encryption (AES-256, ChaCha20) before encoding. Using Base64 to "hide" sensitive data is a common and dangerous mistake.

Why Does Base64 Output Look Longer Than the Input?

Base64 maps every 3 bytes (24 bits) of input to 4 characters (24 bits expressed as four 6-bit values). This means Base64 output is always approximately 33% larger than the raw binary input. A 1 MB image encoded as a Base64 data URI becomes roughly 1.37 MB. This overhead is a known trade-off when using Base64 in performance-sensitive contexts.

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode a Base64 string instantly. It provides no security.

Why is Base64 output larger than the input?

Base64 encodes every 3 bytes as 4 characters, making the output approximately 33% larger than the input.

What are the padding = characters?

If the input length isn't divisible by 3, one or two = padding characters are added to make the output length a multiple of 4.