Base64 Encoder and Decoder
Encode or decode Base64, in the standard or URL-safe alphabet.
About this tool
Encodes text to Base64 or decodes it back, in either the standard alphabet or the URL-safe one.
The two alphabets are the reason this needs a tool rather than a one-liner. Standard Base64 uses `+` and `/`, both meaningful inside a URL, so the URL-safe variant swaps them for `-` and `_` and drops the `=` padding. Decoding a URL-safe string with the standard alphabet either fails or — much worse — returns different bytes without complaining.
Common questions
Is Base64 encryption?
No, and this matters. It is a reversible encoding with no key — anyone can decode it instantly. Base64 hides nothing. Never use it to protect a password, a token or anything else that matters.
What is the URL-safe variant?
The same encoding with `-` and `_` instead of `+` and `/`, and no `=` padding, so the result survives being put in a URL or filename unescaped. JWTs use it.
Why did my decode fail?
Usually the wrong alphabet, or padding stripped somewhere in transit. Try the other mode. A string containing `-` or `_` but no `+` or `/` is almost certainly URL-safe.
Why is the encoded version longer?
Base64 represents three bytes as four characters, so output is about a third larger. That overhead is the cost of making binary data survive text-only channels.