What is Base64?
Base64 is a way of writing any data — text, an image, a file — using only 64 safe characters: A–Z, a–z, 0–9, + and /, with = used as padding at the end. The word "hello" becomes "aGVsbG8=". The result is about a third longer than the original, but it contains no spaces, no line breaks and no characters that could confuse a computer system. That is the whole point: Base64 is a transport format, a way to carry data safely through systems that only accept plain text. Try it in our Base64 Encoder — type anything and watch it change.
Why does Base64 exist?
Many systems only accept plain text. Email was built for letters and numbers, not for binary files — so an email attachment is converted to Base64 before it is sent, and converted back when it arrives. Web addresses cannot contain spaces or most symbols, so data put into a URL is Base64-encoded first. APIs that accept JSON cannot carry raw binary data, so images and files are sent as Base64 strings inside the JSON. Without Base64, every one of these would break on the first strange character.
How encoding works
Encoding takes the bytes of your text, groups them into sets of three, and rewrites each group as four Base64 characters. Decoding reverses the process exactly: four characters back into three bytes. Nothing is lost — decode an encoded string and you get the original text back, character for character. The = signs at the end are padding: they fill the last group when the input is not a multiple of three bytes. You do not need to understand the maths to use it; the tool does the conversion both ways instantly.
Base64 in emails and APIs
If you have ever opened an email's raw source and seen a long block of random-looking letters, that was a Base64 attachment. Developers meet Base64 most often in API tokens and keys: many services hand you a key that is a Base64 string, and you paste it into a settings file. It also appears in configuration files, in data URLs (an image embedded directly in a web page as data:image/png;base64,...), and in authentication headers, where a username and password are sent as one Base64 string.
Base64 in URLs (URL-safe)
Standard Base64 uses + and /, which have special meanings in a web address, so a URL-safe version swaps them for - and _. If you are putting encoded data into a link, tick the "URL-safe" option in the encoder — otherwise the link may break when it is shared or clicked. The two versions carry the same data; only two characters differ, and the decoder accepts either.
Is Base64 encryption?
No — and this is the most important thing to understand. Base64 is not encryption, it is not a password, and it does not hide anything. Anyone can decode a Base64 string in one second, with no key and no password. Never use Base64 to "protect" a password, an API key or a private message — it only changes how the text looks, not who can read it. For real protection, use proper encryption. Base64 is for transport, not for security.
Common mistakes
- Thinking Base64 is secure. It is not encryption — anyone can decode it.
- Using standard Base64 in a URL — the + and / break links; use URL-safe instead.
- Forgetting the padding. A Base64 string without its = padding may fail to decode in strict systems.
- Decoding text that is not Base64 — the tool shows an exact error; check for a missing character or an extra space.