Base64 encoder & decoder
Encode and decode Base64, including the URL-safe variant.
About the Base64 encoder & decoder
This tool encodes text to Base64 and decodes Base64 back to text, with options for the URL-safe alphabet and for dropping padding. Use it to inspect a Base64 value from an API, a config file, or an HTTP header, or to produce one for a data field that only accepts ASCII.
How to use it
- To encode, type or paste text into the Text box and click Encode.
- To decode, paste a Base64 string into the Base64 box and click Decode.
- Check URL-safe to use - and _ instead of + and /, and Without padding to drop the trailing = characters when encoding.
- Use the copy button above either box to copy its contents, or Reset to clear both.
Text and UTF-8
Text is converted to UTF-8 bytes before encoding, so accented letters, non-Latin scripts, and emoji round-trip correctly. Decoding expects the result to be valid UTF-8 text; binary data such as an image shows the Invalid Base64 string error.
Decoding URL-safe input
Missing padding is added automatically when decoding. If the string contains - or _, check URL-safe before clicking Decode.
Privacy
Encoding and decoding run in your browser. Nothing you enter is sent to a server.
Questions
- Is Base64 encryption?
- No. Base64 is an encoding that anyone can reverse without a key. It makes binary data safe to send as text, but it does not hide or protect the content.
- What is URL-safe Base64?
- URL-safe Base64 (base64url) replaces + with - and / with _, because + and / have special meaning in URLs and file names. The padding = is often removed as well, as in JWTs.
- Why is Base64 output longer than the input?
- Base64 represents every 3 bytes as 4 characters, so the encoded output is about 33 percent larger than the original data, plus up to two = padding characters.