Outils · Texte · Encoder et décoder du Base64 · Guides · Base64 Isn't Encryption, and Treating It Like One Is a Real Mistake
Base64 Isn't Encryption, and Treating It Like One Is a Real Mistake
A string like cGFzc3dvcmQxMjM= looks like a secret because it looks like nonsense, and that impression is wrong. Base64 is a reversible encoding, not encryption - anyone who pastes it into a decoder gets the original text back instantly, no password or key required, because there is no key involved at any point. The string above decodes to password123 in less time than it took to read this sentence.
What Base64 is actually for
Base64 exists to carry arbitrary binary data through systems that only expect text - an image inside a JSON payload, a binary attachment in an email, an API key with unusual characters inside an HTTP header. It maps every 3 bytes of input to 4 printable ASCII characters, a mechanical, publicly documented transformation with no secret step anywhere in it. Every programming language, every browser, and dozens of online tools decode it instantly, which is precisely the property that makes it useful for transport and useless for concealment.
Where the mistake actually shows up
The most common real version of this mistake is a Base64-encoded value sitting in a config file, a .env file, or a database column, on the assumption that encoding it makes it "not really" plaintext. It is still plaintext, just written differently - anyone with read access to that file can decode it in one paste, the same as reading it directly, so encoding buys no actual protection against anyone who already has access to the file. A JWT is a sharper version of the same trap: its header and payload segments are Base64URL-encoded, not encrypted, so anyone can decode a JWT's payload and read every claim inside it - a user ID, an email, a role - without needing the server's signing key at all. The signature stops someone from forging a valid token; it does nothing to stop someone from reading one.
The trap is easy to fall into precisely because Base64 output genuinely looks encrypted to someone unfamiliar with it - a block of dense, unreadable-looking characters reads as "protected" the same way a locked-looking box does, even when the lock isn't real. Decoding it back takes one line in any language with a standard library, or a single call to the browser's own built-in atob() function typed straight into DevTools - no cracking, no brute force, no special tooling. That is not a weakness in some particular implementation; it is the entire, documented, intended behavior of the encoding, working exactly as designed.
This confusion is common enough that automated secret-scanning tools built for source-code repositories specifically look for Base64-shaped strings as a signal that a real credential may have been committed by mistake - not because Base64 hides anything from the scanner, but because someone Base64-encoding a secret before committing it is a recognizable, recurring pattern of exactly this misunderstanding playing out in real codebases.
What actually protects something
If something needs to stay unreadable to anyone without permission, it needs real encryption with a key that is not shipped alongside the encrypted value, or it needs to not be stored in a place an attacker can reach in the first place. Base64 has a real, legitimate job right up until the requirement quietly shifts from "make this safe to put in a text field" to "make this unreadable to someone who shouldn't see it" - the moment that shift happens, Base64 is the wrong tool, and no amount of it will close the gap.
This site's Base64 tool runs the whole conversion in your browser - the text you paste, whether it is genuinely sensitive or not, is never uploaded to check what it decodes to.