Base64 encode and decode
Convert any text to Base64 and back, or turn a file or image into a Base64 string ready to paste into your code. Everything runs in your browser: nothing is sent to the server.
What is Base64?
Base64 is an encoding scheme that represents binary data using only 64 printable characters: the letters A-Z and a-z, the digits 0-9 and the symbols + and /, with = as final padding. Every 3 bytes of data become 4 characters, so the result is about 33% larger than the original.
It is used whenever binary data has to travel through channels designed for text: email attachments (MIME), images embedded in HTML or CSS through data URIs, HTTP Basic authentication credentials, JWT tokens or PEM certificates.
Is Base64 encryption?
No. Base64 is an encoding, not encryption: anyone can decode it without a key. Do not use it to hide passwords or sensitive data. If you need to protect a text with a password, use our encrypt text tool with AES.
URL-safe Base64
The + and / characters have a special meaning in URLs, so the Base64URL variant (RFC 4648) replaces them with - and _ and usually drops the = padding. It is the one used, for example, by JWT tokens. The decoder on this page accepts both variants automatically.