Base64 Encode / Decode
base64• Encode or decode text as Base64, including the URL-safe variant. • Handles Unicode as UTF-8 and lets you copy the result.
Unicode text is handled as UTF-8. The URL-safe option replaces + and / with - and _ and drops = padding (for JWTs & query params). Decoding accepts both standard and URL-safe input.
What is Base64?
Base64 is an encoding that represents any data using only 64 letters, digits and symbols. It was designed so binary data could travel through channels that carry text safely — email, URLs, config files.
In practice you meet it in API authorisation headers (Basic auth), in data URIs that embed an image or file as text, and when reading the parts of a JWT. The encoded form is about 33% longer than the original, but it survives any system it passes through without corruption.
One thing to remember: Base64 is not encryption. Anyone can reverse it without a key, so never use it to hide passwords or personal data. Everything here is converted inside your browser and nothing is sent to a server.
Frequently asked questions
Why does Base64 decoding produce garbled text?
This tool encodes and decodes as UTF-8 throughout. Garbled output usually means the original was produced with a different character set, such as EUC-KR or Shift_JIS. In that case you have to undo the Base64 first and then reinterpret the bytes with the correct encoding.
What are the equals signs at the end of a Base64 string?
Base64 takes three bytes at a time and writes them as four characters. When the final group is short, padding fills the gap so the total length stays a multiple of four. That is why you see zero, one or two equals signs, and never three. The number of them even tells you whether the original length was a multiple of three.
How is URL-safe Base64 different from the standard form?
Plus and slash carry special meaning in addresses and file names, so the URL-safe variant writes them as hyphen and underscore and drops the padding. JWTs use this form. Decoding here accepts both variants automatically, so you do not need to convert first.
Can I use Base64 to hide a password?
No. Anyone can reverse it without a key, so it hides nothing at all. A Basic authentication header simply carries the user name and password as Base64, which is why it is readable in plain text unless the request travels over HTTPS. Use real encryption instead.
How long will my Base64 string be?
Divide the number of source bytes by three, round up, then multiply by four. A 100 byte input becomes 136 characters. In short it grows by roughly a third, and dropping the padding in URL-safe mode makes it one or two characters shorter. It is a handy check before pasting a long value somewhere with a size limit.
Why does my Base64 string fail to decode?
Decoding fails when the string contains characters outside the Base64 alphabet, or when part of it was cut off. This tool already strips spaces and line breaks and restores missing padding, so a remaining error usually means the value was damaged while being copied.