Base64 Encode and Decode
Convert text and files to Base64 and back, including the URL safe variant.
EncodingWhat Base64 is for
Base64 represents binary data using only 64 printable characters. It is not encryption and protects nothing: its purpose is to let arbitrary bytes travel through channels that accept text only, such as HTTP headers, email messages or JSON documents.
Text and accented characters
Encoding works on bytes, not characters. Text must therefore be turned into bytes first, and the conversion used here is UTF-8 — which is why accents, symbols and emoji come through intact, while many older tools mangle them.
The URL safe variant
The characters + and / carry their own meaning in web
addresses. The URL safe variant replaces them with - and
_ and drops the trailing padding, so the result can be placed in a
URL as is. Decoding here accepts both variants without being told which.
Size overhead
Base64 grows data by roughly a third: three bytes become four characters. It is a cost worth remembering when embedding images into a page or a stylesheet.
Frequently asked questions
No. It is a representation, not a protection: anyone can decode it instantly. Never use it to hide passwords or sensitive data.
No. The file is read by your browser on your own machine and encoded there: nothing is transmitted.
Usually because the text is missing its trailing padding or contains stray characters. The URL safe variant is recognised and fixed automatically.