Beginner

Base64 Encoder / Decoder

Convert any text to Base64 and back in one click. The tool works entirely in your browser — nothing is sent to a server — and shows the encoded or decoded result alongside a size comparison.

Mode

Base64 encoded output
SGVsbG8sIFdvcmxkIQ==
Input bytes
13 chars
Encoded length
20 chars
Size overhead
7 chars
Overhead ratio
53.8%
65%
35%
Input data
Base64 overhead
Base64 encoding adds ~33% overhead (every 3 input bytes → 4 output chars)
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Base64 maps every 3 input bytes to 4 printable ASCII characters, making binary data safe for text-only channels. Encoded output is ~33% larger than the original. Decoding is the exact reverse. Base64 is an encoding, not encryption — anyone can decode it without a key.

Formula
Encode: every 3 bytes → 4 Base64 chars; encoded length = 4 × ceil(n / 3). Decode: reverse lookup.
How this is calculated

Base64 represents arbitrary binary data using only 64 printable ASCII characters: A–Z (26), a–z (26), 0–9 (10), and two symbols + and / (the standard RFC 4648 alphabet), with = used as padding. To encode, input bytes are grouped into 3-byte (24-bit) blocks and split into four 6-bit values, each mapped to one Base64 character. If the input length is not a multiple of 3, one or two = padding characters are appended to make the output a multiple of 4.

The encoded output is always 4 × ceil(n / 3) characters, which is approximately 33% larger than the input — an inevitable cost for using only 64 safe, printable characters. Decoding reverses the lookup: each group of 4 Base64 characters maps back to 3 bytes. This implementation also supports full Unicode/UTF-8 text by encoding to UTF-8 bytes first, then applying Base64.

Base64 is not encryption — anyone can decode it instantly. It is used whenever binary data must pass through channels that only handle text: embedding images in HTML/CSS, encoding email attachments (MIME), storing binary data in JSON, and constructing data: URIs. For secure transmission, combine Base64 with actual encryption.

Frequently asked questions

No. Base64 is a reversible encoding scheme, not encryption. Anyone who sees a Base64 string can decode it instantly without a key. It is used to make binary data safe for text-only transport, not to protect the data from being read.

Base64 groups input into 3-byte blocks. If the input length is not divisible by 3, one = is appended for 1 leftover byte and == for 2 leftover bytes, ensuring the output length is always a multiple of 4 characters as required by the standard.

The theoretical overhead is exactly 4/3 − 1 ≈ 33.3% for large inputs. For small inputs the = padding can push overhead slightly higher. Line-break characters (used in MIME/PEM formats) add a further ~2.6% on top of that.

APA

TG we-Calculate Editorial Team. (2026). Base64 Encoder / Decoder [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/base64-encoder-decoder-calculator

Chicago

TG we-Calculate Editorial Team. "Base64 Encoder / Decoder." TG we-Calculate. 2026. https://we-calculate.com/calculator/base64-encoder-decoder-calculator.

IEEE

TG we-Calculate Editorial Team, "Base64 Encoder / Decoder," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/base64-encoder-decoder-calculator

BibTeX

@misc{wecalculate_base64_encoder_decoder_calculator, title = {Base64 Encoder / Decoder}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/base64-encoder-decoder-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?