Base64 vs Encryption
Base64 is an encoding: a fixed, public transformation that anyone can reverse, with no key involved. Encryption is a transformation that requires a key to reverse, and is the only one of the two that hides data. They are often confused because both produce unreadable-looking text — and because encryption output is usually Base64-encoded so it can be stored as text. Encoding is how encrypted bytes travel; it is not what protects them.
- Base64: reversible by anyone, no key, no secrecy
- Encryption: reversible only with the key, provides confidentiality
- The test: decode it. If the content appears, it was never protected
- Encrypted output is usually Base64-wrapped — that is packaging, not protection
- JWT payloads are Base64URL: readable by design, verify the signature instead
Processed as you paste — no button to press (Ctrl+Enter converts now / Esc clears)
Drop a file here, or — Ctrl+V a screenshot works too
Any file type · 100 MB maximum
Paste, drag and drop, or Ctrl+V a screenshot
The one test that settles it
Paste the string into a decoder. If readable content comes out — a password, a JSON object, a message — the string was encoded, and every party that received it could do the same. If random bytes come out, it may have been encrypted, but that is not proof either unless you know what the plaintext should look like.
This test is worth running on your own codebase. Strings that "look encrypted" are a common way for credentials to sit in a config file, a log or a database column for years while everyone assumes they are safe. The decoder does not ask for a password because there is none to ask for.
Why the confusion is so persistent
Encryption produces arbitrary bytes, and arbitrary bytes cannot be pasted into JSON, email or a config file. So encrypted output is almost always Base64-encoded before it is stored or transmitted. You see one layer and assume it is the protective one, when in fact the protection came from the layer underneath and the Base64 is only packaging.
The reverse mistake is just as common: because Base64 changes the appearance of data, people assume it changed its accessibility. It did not. The mapping is a published table; a decoder is one line of JavaScript in any browser console.
Where this actually causes harm
Credentials in config files. A database password wrapped in Base64 and committed to a repository is a plaintext password with extra steps. Secret scanners decode Base64 automatically before flagging it.
Tokens that look opaque. A JWT's payload segment is Base64URL — not encrypted. Anyone holding the token can read the claims: user id, roles, expiry, sometimes an email address. The signature proves the token was not modified, which is a different guarantee from confidentiality. If the claims must stay private, they belong in an encrypted layer or behind an API call.
Data at rest. A backup or an export encoded with Base64 passes a "not plaintext" glance and fails every real security review. Encoding survives no threat model at all: not a stolen disk, not a leaked bucket, not a curious support agent.
Compliance claims. Writing "data is encoded" in a policy document where a regulator expects encryption is a finding waiting to happen, and a hard one to argue once the timeline is reconstructed.
What actually protects data
In transit, TLS. The bytes on the wire are encrypted by the connection, which is why the Base64 inside an HTTPS body adds nothing — and why the same body sent over plain HTTP is exposed regardless of how it is encoded.
At rest, authenticated encryption such as AES-GCM, with keys held in a key management service rather than in the same repository as the ciphertext. Authenticated matters: it detects tampering, which plain encoding and unauthenticated modes do not.
For passwords, neither. Passwords should be hashed with a slow, salted algorithm — bcrypt, scrypt or Argon2 — because you never need to read them back. Encrypting passwords is a design error that turns one key compromise into every user's password.
For integrity, a signature or an HMAC over the payload. That is what a JWT signature does, and it is the part you should be verifying.
The practical rule
Ask what the transformation is for. If the goal is "this must survive a channel that only carries text", use Base64. If the goal is "only the intended party may read this", use encryption with a managed key. If the goal is "this must not be reversible", use a hash. Choosing the wrong one is not a performance detail — each answers a different question.
Frequently asked questions
Does Base64 offer any security benefit at all?
Only indirect ones. It prevents accidental interpretation of bytes — a binary blob pasted into a text field will not corrupt a parser — and it keeps some naive scanners from matching plaintext patterns. Neither is a control you can rely on.
If I Base64-encode an encrypted value twice, is that stronger?
No. Encoding layers are fully reversible and add nothing. Strength comes from key length, algorithm choice and key custody, not from how many times the output is reformatted.
Is a JWT encrypted?
By default, no — a JWS (the common JWT) is signed, not encrypted: the payload is readable and the signature prevents tampering. JWE is the encrypted form. If a token carries claims that must stay private, it needs JWE or server-side storage.
Can I tell encryption from encoding by looking at the string?
Not reliably. Both often look like Base64 because that is how binary is carried as text. The only dependable check is to try decoding it and see what comes out.