Base64 Encoder & Decoder
Convert text to Base64 and back, with UTF-8 support handled correctly for emoji and international text.
What Base64 actually is
Base64 is a binary-to-text encoding. It takes raw bytes and represents them using 64 printable ASCII
characters (A–Z, a–z, 0–9, + and /, with
= as padding). It exists because many transport systems — email, URLs, JSON payloads, HTTP
headers — were built to carry text and mangle raw binary data passed through them.
Base64 is not encryption. Anyone can reverse it instantly. It provides zero confidentiality, and treating it as if it did is one of the most common security mistakes in web code.
Why so many Base64 converters get emoji wrong
This is the single most visible difference between a correct implementation and a sloppy one. JavaScript's
legacy btoa() throws an error on any character above U+00FF, and the old workaround of looping
with String.fromCharCode() corrupts multi-byte UTF-8 sequences. The result is that emoji and
non-Latin scripts come out as mojibake.
This tool encodes through TextEncoder, which produces genuine UTF-8 bytes, and reverses it
through TextDecoder. Multi-byte characters survive the round trip intact:
| Input | Base64 |
|---|---|
Hello | SGVsbG8= |
你好 | 5L2g5aW9 |
🚀 | 8J+agA== |
Привет | 0J/RgNC40LLQtdGC |
Base64 vs Base64URL
The standard alphabet uses + and /, both of which require escaping inside URLs
and filenames. The Base64URL variant swaps those for - and _ and
drops the = padding. Base64URL is what JWTs use, and it is why a JWT segment can sit directly
inside a URL without breaking.
Common uses
- Embedding small images inline as
data:URIs in CSS and HTML - Sending binary attachments through JSON APIs
- Basic Authentication headers, where
user:passwordis Base64-encoded - Transporting certificate and key material through text-only systems
- Encoding the segments of a JSON Web Token
Security note. Base64 is reversible by anyone. Never use it to hide secrets, tokens or credentials. It is a transport encoding, not a protection mechanism.
Privacy. Encoding and decoding run entirely in your browser. Text you paste into this page is never uploaded or transmitted anywhere.
Frequently asked questions
Why is my decoded output full of strange symbols?
The original data probably was not text. Base64 is often used to encode images, archives or other binary formats. This tool is designed for text round trips; for image or file decoding you want a file-oriented converter.
Why does Base64 make my text about 33% longer?
Every three bytes of input become four Base64 characters, so the output is roughly 4/3 the size of the input. Padding rounds this up further when the length is not divisible by three.
What does the "=" sign at the end mean?
It is padding. Base64 works in groups of three input bytes; any leftover bytes are filled out with trailing "=" characters so the length is a multiple of four.
Is there a length limit?
No. Processing happens locally on your device, so the only constraint is your browser's available memory.
Can this handle line breaks inside the Base64 string?
Yes. Whitespace and newlines are stripped before decoding, which is useful for PEM blocks and certificates that wrap at 64 characters per line.