Base64 is a way of writing any data, including binary files, using only 64 plain text characters (A–Z, a–z, 0–9, + and /). It is used to carry data through systems built for text, such as email attachments, data URLs, API keys and JSON Web Tokens.
Base64 is not encryption
Anyone can decode Base64 in one step, with no key. Credentials that are only Base64-encoded, like an HTTP Basic auth header, are as exposed as plain text unless they travel over HTTPS.
Security teams decode Base64 all the time to read suspicious scripts, email bodies and tokens, because attackers use it to hide content from simple filters.
Standard vs URL-safe Base64
| Standard | URL-safe (Base64URL) | |
|---|---|---|
| Characters 62 and 63 | + and / | - and _ |
| Padding | = at the end | Usually removed |
| Used in | Email (MIME), data URLs | JWTs, URLs, file names |
The decoder accepts both forms automatically. Tick the URL-safe option when encoding for a URL or token.
Text and binary
We encode text as UTF-8, so accented letters, emoji and other scripts round-trip correctly. When decoded data is not valid text, such as an image or a compressed file, we show a hex preview instead of garbled characters.
Size
Base64 makes data about 33% larger, because every 3 bytes become 4 characters. That is the trade-off for being safe to send as text.
Privacy
Decoding and encoding run in your browser. Tokens or secrets you paste are not sent anywhere.
Decoding a token? The JWT decoder splits it into header and payload and flags risky settings.
Frequently asked questions
Is Base64 secure?
No. It is an encoding, not encryption. Anyone can decode it without a key.
Why does my Base64 end with = signs?
They are padding that makes the length a multiple of 4. URL-safe Base64 usually drops them, and the decoder handles both.
What does invalid Base64 mean?
The input has characters outside the Base64 alphabet or a length that cannot be decoded. Check for missing or extra characters from copying.
Can I decode an image?
Yes. Binary results are shown as a hex preview. For data URLs, remove the data:image/png;base64, prefix first.