What the Base64 Encode and Decode does
This tool converts text to Base64 and back. Base64 writes any data using only letters, digits and a few symbols, so it can travel safely inside emails, JSON, URLs and HTTP headers. The tool handles every language and emoji correctly by encoding text as UTF-8 first, and it can produce or read the URL-safe variant used in tokens and web addresses.
How to use it
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- Paste your input. The result appears immediately.
- For encoding, tick URL-safe to use
-and_instead of+and/and drop the=padding. - Press Use output as input to reverse the operation and check the round trip.
Example
To send the username and password api:s3cret in a Basic authentication header, encode it to get YXBpOnMzY3JldA== and send Authorization: Basic YXBpOnMzY3JldA==. Decoding that value later gives back api:s3cret exactly.
Good to know
Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or personal data. Encoded text is about a third longer than the original.
Decoding accepts both the standard and URL-safe alphabets, ignores spaces and line breaks, and adds missing padding for you. If the decoded bytes are not valid UTF-8 text, for example because they are part of an image, the tool says so instead of showing garbled characters without warning.
Questions people ask
Why does my decoded text show strange characters?
The Base64 probably holds binary data, such as an image or a compressed file, rather than text. The status line warns you when that happens.
Can I encode a file or an image?
This tool encodes text. For images, use Image to Base64, which also gives you a ready-made data URI.
What does the = at the end mean?
It is padding that makes the length a multiple of four. URL-safe Base64 often leaves it out; this decoder works either way.
Is my input private?
Yes. Encoding and decoding happen in your browser.