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.
How to use it
Paste the text — or pick a file, since encoding works on any binary — and the result appears beside it; decoding works the same way. Everything happens in the browser: what you paste is never uploaded anywhere.
Where you meet it
In the inline images of stylesheets, which become
data:image/png;base64,...; in e-mail attachments, which the protocol
transmits that way; in the HTTP Basic authentication header; in the first segment
of JWT tokens, which is precisely Base64 in its URL safe variant. Recognising it
on sight is easy: long runs of letters, digits, + and /,
closed by one or two =.
A quick example
The four characters TWFu are the word "Man": three bytes of ASCII
become four printable characters, and the padding = appears only
when the last group carries fewer than three bytes.
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.
With the SmartTools Base64 tool: paste the text — or pick a file — and immediately get the encoding, or recover the original text from the encoded string. It is free, needs no registration, and the conversion happens in your browser, so even files stay on your own computer.