What it does
This tool converts text to Base64 and back. Switch to Encode to turn any text into a Base64 string, or Decode to read a Base64 string back into the original text. It runs entirely in your browser — nothing you type is sent anywhere — and it is Unicode-aware, so accented letters and emoji come through intact.
How it works
Base64 represents binary data using only 64 printable ASCII symbols: A–Z, a–z, 0–9, plus + and /. It works in groups of three bytes. Three bytes are 24 bits; Base64 splits those 24 bits into four 6-bit chunks, and each 6-bit value (0–63) picks one symbol from the alphabet. So every 3 bytes of input become exactly 4 characters of output — Base64 is always about a third larger than the data it carries.
When the input length is not a multiple of three, the final group is short. The encoder pads the missing bits with zeros and appends = characters to mark how many bytes were padding: one = when two bytes remain, two = when one byte remains. That padding is what lets a decoder reconstruct the exact original length.
Text first has to become bytes. This tool encodes your text as UTF-8 before applying Base64, which is why characters outside plain ASCII work correctly — each is expanded into its UTF-8 byte sequence first. Decoding reverses both steps: Base64 back to bytes, then UTF-8 back to text.
Base64 is not encryption. It is a reversible encoding with no key and no secret — anyone can decode it. Use it to move or store data safely in text-only channels, never to protect it.
Worked example
Encoding hare=speed gives aGFyZT1zcGVlZA==. The text is 10 bytes, which is not a multiple of three, so the last group is short and the result ends in ==. Decoding aGFyZT1zcGVlZA== returns the original hare=speed exactly.
Common uses
- Data URIs: embedding a small image or font directly in HTML or CSS as
data:image/png;base64,…, avoiding an extra network request. - Binary inside text formats: carrying an image, file, or raw bytes inside JSON, XML, or an email body, none of which can hold arbitrary binary safely.
- HTTP Basic auth: the
Authorizationheader sendsusername:passwordas Base64 — encoded for transport, not secured (which is why Basic auth needs HTTPS). - Tokens and config: the segments of a JWT, and many API keys and certificates (PEM files), are Base64 so they stay copy-paste friendly.
Frequently asked
Is Base64 encryption?
No. There is no key and nothing secret — the algorithm is public and fully reversible, as the Decode side of this tool shows. It hides nothing; treat a Base64 string as readable as the original. For confidentiality you need actual encryption.
Why does the output end in =?
The = characters are padding. Base64 works in blocks of three bytes; when the input does not divide evenly, the encoder adds one or two = to signal how many bytes in the last block were real. An output with no = means the input length was an exact multiple of three.
Does it work with emoji and other Unicode?
Yes. The tool converts text to UTF-8 bytes before encoding, so accented letters like café and emoji are preserved and decode back exactly. A naive encoder that skips the UTF-8 step would corrupt or reject these characters.
What happens if I decode something that is not valid Base64?
The tool shows Not valid Base64 instead of a broken result. Valid Base64 uses only the 64 alphabet symbols plus padding; stray characters or a wrong length cannot be decoded.