Wizard Toolbox Tool map

Base64 Encode and Decode

Type text to encode it, or switch to Decode and paste Base64. Accents and emoji come back exactly as they went in.

Direction

Text becomes bytes first

Base64 encodes bytes, not letters, so the text is turned into UTF-8 first. Plain English letters are one byte each; é is two and most emoji are four, which is why café (5 bytes) encodes to the 8 characters Y2Fmw6k=. Decoding turns the bytes back into UTF-8 text, so what went in comes out unchanged.

URL-safe Base64

URL-safe uses the base64url alphabet from RFC 4648: - and _ in place of + and /, and no = padding at the end, as JWTs and many APIs use it. Decoding accepts either alphabet, with or without padding, and ignores spaces and line breaks, so Base64 copied from an email wrapped at 76 characters decodes too.

Checking a result

Use as input moves the result up into the box and turns the direction round, so an encoded string is decoded straight back and you can see it matches. Characters that are not Base64, or = anywhere but the end, are named in the line under the box.

Questions

Is Base64 a kind of encryption?

No. It only rewrites bytes in 64 safe characters, and anyone can decode it with no key. To hide a message, use Encrypt Text, which locks it with a password.

Why is the Base64 longer than my text?

Every 3 bytes become 4 characters, so Base64 is about a third longer than the bytes it holds, plus up to two = at the end to fill the last group.

Why does decoding say the bytes are not UTF-8 text?

The Base64 holds something other than text, most often an image or another file. This page only shows text, so it says so rather than showing a screen of garbled characters.

Worked out in this page, on your device · nothing is sent anywhere