What is Base64?
In a payment gateway's settings or a message from your developer, you find odd text like 2YXYsdit2KjYpw== and wonder: is this encrypted? It is not. This is Base64, and anyone can read it in a second.
What is Base64?
A way to write any data, text or image, using only 64 safe characters: upper and lower case English letters, digits, + and /. Systems use it to move data through channels that only accept text, like email or some APIs.
The word «مرحبا» becomes 2YXYsdit2KjYpw==.
It is 5 letters but 10 bytes in UTF-8, and every 3 bytes become 4 characters, so it ends with two = signs.
And the text SGVsbG8, with no = at the end, decodes to Hello, with a note that one = was missing and was added.
Encoding, not encryption
This is the most important thing to know. Base64 needs no key or password to decode. Anyone who sees an API key or password encoded in Base64 sees it exactly as it is. Do not rely on it to hide anything, and do not share encoded text that holds secret data.
How to do it
- Open the Base64 encoder/decoder tool and choose encode or decode.
- Type or paste your text, or choose a file of up to 5 MB.
- When decoding, the tool checks the input first, and tells you if the result is an image or a file rather than text.
- Copy or download the result.
When decoding fails
- A character outside the Base64 alphabet: the text SGVs*bG8= is refused because the * at position 5 is not in the alphabet.
- If the result is not text, such as a PNG image or a PDF, the tool shows the file type and lets you download it instead of showing garbled characters.
- The tool accepts the standard alphabet and the URL-safe one, but refuses a mix of the two.
If the encoded text sits inside a link, it may also need URL decoding with the URL encoder/decoder. If one-line JSON appears after decoding, format it with the JSON formatter and validator.
Common questions
Is Base64 safe for storing passwords?
Not at all. Anyone can decode it instantly. Use real encryption or a password manager.
Why does the size grow after encoding?
Because every 3 bytes become 4 characters, so the size grows by about a third.
Is my text sent to a server?
No, everything happens inside your browser.
