Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to plain text.
About this tool
Encode plain text into Base64, or decode Base64 back into readable text, entirely in your browser. Unicode input — emoji, accented letters, non-Latin scripts — is handled correctly because the text is converted to UTF-8 bytes before encoding and back again on the way out.
What Base64 is for. Some channels only reliably carry printable ASCII: email bodies, JSON string values, data: URLs, a few HTTP headers. Base64 takes arbitrary bytes and rewrites them using just 64 safe characters — A–Z, a–z, 0–9, + and / — with = as padding, so binary-ish data can pass through a text-only path without being corrupted.
How it works. Base64 processes input in groups of 3 bytes (24 bits), turning each group into 4 characters of 6 bits each. That's why the output length is always a multiple of 4, and why encoded data is about 33% larger than the input. When the input isn't a multiple of 3 bytes, one or two = signs pad the final group. "Hi" becomes SGk=; "Hello" becomes SGVsbG8=.
Base64 is not encryption. There's no key and the transformation is completely public — anyone can decode it in a second, as this tool does. Never use Base64 to hide a password, token, or any other secret; treat Base64 text as fully readable.
The base64url variant. Standard Base64 uses + and /, which have special meaning in URLs and filenames. The base64url variant swaps them for - and _ and often drops the padding. JSON Web Tokens use base64url for each of their three parts — decode those with the JWT decoder instead.
For escaping values inside a URL rather than encoding bytes, use the URL encoder; for showing literal < or & characters in HTML, use the HTML entity encoder. The guide to Base64, URL encoding and HTML entities explains when each one applies.
Frequently asked questions
- Is Base64 encryption?
- No. Base64 is an encoding, not encryption. It's fully reversible by anyone with no key, and provides no confidentiality or security on its own.
- Why is my Base64 output longer than the input?
- Base64 represents every 3 bytes as 4 characters, so the output is roughly 33% larger. The length is always a multiple of 4, with
=padding on the last group if needed. - Does this handle Unicode and emoji correctly?
- Yes. Text is converted to UTF-8 bytes before encoding, so emoji, accented characters, and non-Latin scripts round-trip exactly.
- What happens if I paste invalid Base64 in decode mode?
- A hint appears explaining that the input isn't valid Base64, instead of showing garbled output. Common causes are missing padding, stray whitespace, or a base64url string with
-/_characters. - What's the difference between Base64 and base64url?
- base64url replaces the
+and/characters with-and_so the result is safe in URLs and filenames, and usually omits the=padding. It's used by JWTs and many web APIs. - Can I Base64-encode a file?
- This tool works on text. To embed a small image or file as a
data:URL you'd Base64 its raw bytes — a dedicated file-to-Base64 step — but the encoding itself is the same.