Plain text to encode, or an encoded string to read.
2
Pick the direction
Encode or decode, and whether to use the URL-safe alphabet.
3
Copy the result
The output reports its length; nothing is sent anywhere.
Base64 is not encryption
Base64 is a way to write arbitrary bytes using 64 printable characters, so binary data can travel through systems that only accept text. Anyone can decode it with no key. It hides nothing, and a string that looks scrambled to a person is plain text to a program.
The cost is size: every three bytes become four characters, so Base64 is about 33% larger than the input. That is why images embedded in CSS or JSON are Base64 only when the request count matters more than the bytes.
Why accents break naive tools
The browser's original btoa works on one byte per character. Pass it a string with é, and it either throws or silently mangles the byte. This tool converts the text to UTF-8 first, then encodes those bytes, so accented letters, Cyrillic and emoji all round-trip correctly.
Decoding does the reverse: bytes are decoded as UTF-8, and if they are not valid UTF-8 the tool says the data is probably binary rather than printing replacement characters. A Base64 blob of a PNG will not decode to text, and pretending otherwise is how people think an image is corrupted.
The URL-safe variant
Standard Base64 uses + and /, which have meaning in a URL, and padding =, which does not belong in a query value. The URL-safe alphabet replaces them with - and _ and drops the padding. JWT segments use exactly this variant, with the padding removed.
Decoding accepts either alphabet here, because a mixture is common when a value has been through a URL and back. If you are encoding for a URL parameter, still percent-encode the result: = and + are safe only after escaping. For hashing rather than encoding, use the hash generator.
Frequently asked questions
Can it encode an image?Not as a file here. This page handles text. Use the image to Base64 converter for a picture, and note the 33% size increase.What is URL-safe Base64?The alphabet that uses - and _ instead of + and /, with the padding removed, so the value survives a query string.Why does decoding fail?The input is not valid Base64, or the bytes are not UTF-8 text, for example a PNG. Both cases are reported separately.Are line breaks allowed in the input?Yes. Whitespace is removed before decoding, so wrapped Base64 from an email works.Is my text uploaded?No. Encoding and decoding use the browser's own functions in this tab.Is Base64 secure?No. It is encoding, not encryption. Use AES for anything secret.