JiffyGadgets
All tools / CH 09 · Base64 Encoder & Decoder

09Base64 encoder & decoder

Text to Base64 and back, with accents and emoji handled properly.

How it works

Base64 represents binary data using 64 printable characters, expanding it by about a third in exchange for surviving any channel that only handles text. Encoding here converts your text to UTF-8 bytes first, which is why accented characters and emoji come back intact — the common bug in naive implementations is skipping that step and mangling anything outside ASCII.

The URL-safe option swaps the two characters that cause trouble in a URL or file name, + and /, for - and _, and drops the trailing padding. Decoding accepts either alphabet and restores padding automatically.

Common questions

Is Base64 encryption?

No, and this matters. It is a reversible encoding with no key — anyone can decode it in seconds. Never use it to protect a password or a secret.

Why did my decode fail?

Usually the string was truncated in copying, or it was never Base64 to begin with. It can also fail if the data decodes to binary rather than text, such as an encoded image.

What is the padding for?

Base64 works in three-byte groups. When the input does not divide evenly, = marks how many bytes were short. Some systems omit it, so padding is restored automatically before decoding.

Can I encode a file?

Not on this page — it handles text only. Encoding a file needs a reader that turns it into bytes first, which is a different tool.