Base64 Encode / Decode
Encode and decode Base64, UTF-8 safe, with URL-safe variant.
About this tool
Convert text to Base64 and back. Handles any Unicode text correctly and supports the URL-safe alphabet (base64url) used in JWTs and URLs.
How to use it
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Paste your input. Unicode text such as accents or emoji is handled correctly.
- For tokens and URLs, turn on URL-safe to use - and _ instead of + and /.
- Copy the result, or click Swap to reverse the operation.
Questions
- Is Base64 encryption?
- No. Base64 is an encoding that anyone can reverse instantly. Never use it to hide passwords or secrets.
- What is the difference between Base64 and Base64url?
- Base64url replaces + with - and / with _ and usually drops the = padding, so the result can be used in URLs and file names. JWTs use Base64url.
- Why does decoding fail?
- Either the input has characters outside the Base64 alphabet, or it decodes to binary data rather than UTF-8 text, such as an image or a compressed file.
- Why is the encoded text longer?
- Base64 represents every 3 bytes with 4 characters, so the output is about 33% larger than the input.
Something not working, or a result looks wrong? Report a problem with this tool