Skip to content · 跳到主要内容

Base64 Encode Decode Calculator

Free base64 encode decode calculator with a clear formula and instant result

Enter text

Result
--
--
Output length

Base64 Encode Decode

Encode text as Base64 or decode a Base64 string in the browser. UTF-8 text is handled before the conversion.

How it works

encode = Base64(UTF-8 text)
decode = UTF-8(Base64 text)

What Base64 actually does

Base64 takes three bytes of binary data and represents them with four characters drawn from a 64-character alphabet. That inflates the payload by about a third but guarantees the result contains only letters, digits and two symbols, so it can travel through systems that accept text only. It is an encoding, not encryption: anyone can reverse it, and it offers no protection for the content.

Common pitfalls

Padding with equals signs is required when the input length is not a multiple of three, and some decoders reject a string with missing or extra padding. Line breaks and spaces inserted by email or chat clients also break decoding and must be removed first. Because the encoding applies to bytes rather than characters, text is converted to UTF-8 first, which is why one Chinese character becomes several Base64 characters rather than one. URL-safe variants swap two symbols so the output can appear inside a query string.

Frequently Asked Questions

Does Base64 encrypt my data?

No. It is a reversible encoding with no key, so it hides nothing from anyone who has the string.

Why does the output get longer?

Every three bytes become four characters, so the size grows by about a third, plus padding.

Why does decoding sometimes fail?

Missing or extra padding, or line breaks and spaces inserted by email and chat tools, are the usual causes.

What is URL-safe Base64?

A variant that replaces the characters plus and slash so the string can be placed safely inside a URL or filename.

Last reviewed: October 5, 2026 · How we calculate · Sources: Published formula reference; verify domain-specific assumptions before making a decision