What Base64 is, and what this tool does
Base64 is a way of writing any data — text, an image, a file — using only 64 safe characters: the letters A–Z and a–z, the digits 0–9, and the two symbols + and /. It exists because many systems that move information around were built for plain text: email, early web forms, configuration files, web addresses. Feed such a system raw binary data, or text full of unusual characters, and something along the way will mangle it. Encode the data as Base64 first and it travels as an ordinary, unremarkable string of letters that every system handles the same way. This tool does both directions: Encode turns your text into its Base64 form, and Decode turns Base64 back into the original text. Unlike many simple converters, this one is fully Unicode-safe — accented letters, currencies, symbols and emoji all survive the round trip, because the text is first converted to its UTF-8 bytes, which is the same representation modern systems use.
A quick example to check against any reference: the word hello encodes to aGVsbG8=. Try it above.
How Base64 encoding works
The encoder reads your text three bytes at a time. Three bytes are 24 bits; Base64 splits those 24 bits into four groups of 6 bits, and each 6-bit group (a number from 0 to 63) selects one character from the 64-character alphabet. Four characters come out for every three bytes in — which is why Base64 text is always about a third longer than what it encodes, a fact worth knowing when you meet it inside a data URI or an email. When the input does not divide neatly by three, the output is padded with one or two = signs so its length is always a multiple of four; that is why so many Base64 strings end in = or ==, and why a valid one never starts with it. Decoding runs the same steps backwards, and a decoder will refuse — as this one does — if the string contains characters outside the Base64 alphabet or is cut off mid-group.
Where you will meet Base64
- Email: attachments and non-English text are carried as Base64 (MIME encoding), which is why raw email source looks like walls of letters.
- Data URIs: small images and fonts embedded directly in CSS or HTML as Base64, so the page needs no separate file request.
- APIs and tokens: authentication headers, JSON web tokens and API payloads carry Base64 (often the URL-safe variant) as a transport format.
- Configuration and certificates: keys, certificates and stored settings are commonly kept in Base64 (PEM) form so they can live in plain text files.
One warning that matters: Base64 is not encryption. Anyone can decode it — you just did, with a public tool. It hides text from a casual glance and nothing more, so never treat a Base64 string as a safe way to store a password or a secret.
Frequently asked questions
Why do Base64 strings end in an equals sign?
The '=' characters are padding. Base64 output is produced in blocks of four characters, and when the original data does not fill the final block, one or two '=' signs complete it. Strings whose length already divides evenly have no padding.
Can this tool encode emoji and accented characters?
Yes. The text is converted to UTF-8 bytes before encoding — the standard approach — so 'café' or a line of emoji encodes and decodes losslessly. Simpler converters that encode character-by-character throw an error on anything outside basic Latin text.
Is Base64 a secure way to protect information?
No. Base64 is an encoding, not encryption — there is no key and no secret, and anyone can decode it instantly, as this page demonstrates. Use it to transport data safely through text-only systems, never to hide sensitive information.
What does 'Invalid Base64 string' mean?
The pasted text contains a character outside the Base64 alphabet (A–Z, a–z, 0–9, +, /, =), or it has been truncated. A common cause is copying only part of a long string, or copying a URL-safe variant that uses - and _ in place of + and /.
Private by design: this converter runs entirely in your browser. The text you encode or decode here is never uploaded, stored or shared.