Encoding vs Encryption vs Hashing: Why Base64 Isn't Security

4 min read

"Is Base64 secure?" comes up constantly, and the honest answer is that it's not attempting to be — it's not in the same category as encryption or hashing at all. These three operations look superficially similar (they all turn readable text into something that looks scrambled) but solve completely different problems.

Encoding: reversible, no secret required

"Hello" → Base64 encode → "SGVsbG8=" → Base64 decode → "Hello"

Base64 is encoding: a reversible transformation with no key, no password, nothing secret involved anywhere. Its entire purpose is representing binary data using only text-safe characters — see our Base64 explainer for the mechanics. Anyone can decode it instantly, including our own Base64 Decoder. It was never designed to keep anything secret, and treating it as if it does is a real security mistake, not a theoretical one — Base64-"protected" data in a URL, a config file, or a cookie is exactly as exposed as if it were left in plain text.

Encryption: reversible, but only with a key

"Hello" → encrypt with key K → ciphertext → decrypt with key K → "Hello"

Encryption is also reversible, but reversing it requires a secret key. Without that key, recovering the original data from strong, correctly-implemented ciphertext is computationally infeasible. This is the actual tool for "keep this confidential" — AES, RSA, and similar algorithms are built and vetted specifically for that purpose, unlike Base64.

Hashing: one-way, not reversible at all

"Hello" → hash → "185f8db32271fe25f561a6fc938b2e26..." → (no way back)

Hashing produces a fixed-length digest from arbitrary input, and it's deliberately one-way — there's no key that reverses a hash back to its input. This makes it the right tool for a different job entirely: verifying data hasn't changed (checksums), or storing a password in a way where even a full database leak doesn't hand over the original passwords (assuming a proper password-hashing algorithm, not a fast general-purpose hash).

Side by side

  • Encoding (Base64) — reversible, no key, goal is text-safety and transport, not secrecy.
  • Encryption (AES, RSA) — reversible only with the right key, goal is confidentiality.
  • Hashing (SHA-256, bcrypt) — not reversible at all, goal is integrity verification or one-way storage.

Where this actually bites people

The most common real mistake: putting a credential or token through Base64 and treating the result as "obscured enough." A JWT's payload is a textbook example — it's just base64url-encoded JSON, readable by anyone who has the token, which is exactly why our JWT Decoder can display it with no key required at all. If data genuinely needs to stay confidential, it needs real encryption, not an encoding scheme that happens to make it look unreadable at a glance.

Try Base64 Encode now

Encode plain text to Base64 instantly in your browser.

Open Base64 Encode