Guide · Security

Base64 Is Not Encryption: Encoding vs Secrets

Updated 2026-08-26 · 7 min read

Search fills with “encode my password Base64” and “decrypt Base64.” Those queries mix three jobs. Encoding changes representation. Encryption hides data from people without a key. Hashing fingerprints data and is not meant to reverse.

Base64 is encoding. DevOkk’s Base64 Encoder will encode and decode in the browser so you can debug a data URL or a JWT segment without sending the string to a random “decrypt” site. It will not make a secret. The how-to for the buttons is How to encode and decode Base64 without a server. This article is the misconception.

What Base64 actually does

Bytes in, ASCII out. The alphabet is A–Z, a–z, 0–9, +, /, and = padding. Three bytes become four characters. Size grows by about 33%. That is the opposite of compression and the opposite of a cipher.

You use it when a protocol wants text: embedding a small image as a data:image/png;base64,... URL, stuffing binary into JSON, HTTP basic auth’s user:pass (which is also not encryption - it is obfuscation on the wire unless you add TLS).

Reverse is free. There is no key. If the encoded blob is in the HTML, the image is in the HTML.

Why it looks “secret”

The string is ugly. Ugly is not confidential. SGVsbG8= is Hello. People paste API keys into a Base64 field, commit QVBJX0tFWT0..., and believe they avoided GitHub’s scanner. Scanners decode. Attackers decode. Base64 Encoder decodes.

Obfuscation can stop a casual glance over a shoulder. It does not stop a paste into a decoder. If the threat is a roommate seeing the monitor, a password manager window is the control. If the threat is a leaked repo, encoding never was.

Encoding vs encryption vs hashing (keep this table in your head)

JobReversible with a public algorithm?Hides from someone without a key?Example tool
Base64 / hex / URL-encodeYesNoBase64 Encoder, URL Decoder
Encryption (AES, TLS)Only with the keyYes, if used correctlyNot a DevOkk page - use real crypto libraries
Hash (SHA-256)No (by design)Not encryption; rainbow tables exist for weak hashesHash Generator

HTML entities are encoding too: HTML Encoder. They stop <script> from running as HTML. They do not encrypt the script source.

JWTs: readable on purpose

A signed JWT’s first two segments are Base64url(JSON). Anyone with the token reads email, exp, roles. The third segment is a signature, not more JSON. Decoding is not verifying. JWT Decoder shows claims locally. jwt.io vs a browser JWT decoder is which site. Putting a password inside JWT claims and Base64-ing the token is still a password in the token.

Encrypted JWTs (JWE) are a different layout (typically five segments). A simple Base64 pass will not yield JSON. Do not paste JWE keys into a website.

Basic auth, data URLs, and email

Basic auth. Authorization: Basic plus Base64(user:pass). TLS is what protects it on the network. Without HTTPS, Base64 is a postcard. Rotate if it leaked.

Data URLs. Fine for tiny icons. A 4 MB photo as Base64 in CSS is a performance bug, not a security feature. Compress the image first: Online Image Compressor.

Email attachments. MIME uses Base64. That is why a 24 MB file can miss Gmail’s 25 MB cap. Email attachment size limits. Encoding overhead is not encryption of the PDF.

What to paste where

Production keys: vault, not Base64 Encoder, not ChatGPT, not a “decrypt online” ad. What not to paste into online developer tools.

Dummy strings and public data URLs: local encoder is fine.

If you must see what a captured Base64 blob is, decode locally, then delete the blob from the ticket.

A worked example: “encrypted” config

A .env contains SECRET=c3VwZXJzZWNyZXQ=. Someone wrote “we Base64’d it so it’s encrypted.” Decode in Base64 Encoder. You get supersecret. Put a real secret in the manager, rotate the leaked one, never encode-as-security again.

If they meant “we hashed it,” check: hashes are hex/base64 digests of fixed length for a given algorithm, not a round-trip. Hash Generator will not “decrypt” SHA-256. If they can round-trip, it was encoding.

Padding, unicode, and “it won’t decode”

Wrong variant (url vs standard), missing =, UTF-8 vs UTF-16, or a gzip blob that was Base64’d twice. Decode once, inspect. If the output is still ASCII Base64, decode again on purpose, not because the first pass “failed.” Pretty-print JSON after decode with JSON Formatter if the bytes were a payload.

Base64 is a transport costume. Encryption is a lock. Hashing is a fingerprint. Use Base64 Encoder to change clothes, not to hide the keys. The companion how-to is the encode/decode guide; this page is so you stop calling it decrypt.

ROT13, hex, and other costumes

Hex dumps, Punycode, quoted-printable, and ROT13 get the same magical thinking. They are encodings or jokes. Number Converter will move between bases. That is not AES. If a vendor says “we encrypt at rest” and means Base64 in S3, they do not encrypt at rest.

URL encoding is the other daily mix-up. %3D is =. Tokens in query strings are still tokens after URL Decoder. HTTPS hides them from the coffee-shop sniffer; it does not hide them from the access log of the site you called.

“Encrypted” malware and email filters

Attackers Base64 payloads so naive filters miss powershell. Defenders decode. You should decode suspicious strings in a safe environment, not on a random website that might be the attacker. Local Base64 Encoder on a throwaway VM is closer to sane than “decrypt online” ads.

Unicode and footguns

JavaScript’s btoa vs UTF-8, Node buffers, and TextEncoder produce different Base64 for the same emoji. If two systems disagree, it is encoding of characters, not a broken cipher. Decode to bytes, then interpret as UTF-8. JSON Formatter after you have JSON, not before.

Compliance one-liners you can reuse

“Base64 is not a control.” Put it in the security review template. Encryption in transit is TLS. Encryption at rest is a KMS. Password storage is argon2/bcrypt. Encoding is for protocols.

If a ticket says “please encrypt this file with Base64 before emailing,” reply with this article and PDF Compressor or a real encrypted channel.

PEM, certificates, and Slack as a vault

PEM files wrap Base64 between BEGIN / END banners. BEGIN PRIVATE KEY is still a private key. BEGIN CERTIFICATE is a public cert - still not something to paste into a random decoder if the rest of the bundle includes the key. Slack is not a vault. Decode PEM only on a machine that should hold it.

A CSR is Base64 too. Sharing a CSR is normal. Sharing the matching private key is an incident. The costume looks identical in a chat window. Read the banner.

Email folklore: “the attachment is encoded so it is safe”

MIME uses Base64 so 8-bit files survive 7-bit paths. That is why a 24 MB PDF can miss a 25 MB cap after encoding overhead. It is not confidentiality. Anyone who receives the message has the PDF. Email attachment size limits.

JSON sitting inside Base64 sitting inside JSON

APIs nest encodings. Decode once, ask what you have, decode again only if the bytes are still ASCII Base64. Pretty-print with JSON Formatter when you land on JSON. If you land on a JWT, stop treating it as a password and open JWT Decoder. Nested encoding is not layered encryption.

Length as a tell in code review

A SHA-256 digest in hex is 64 characters. In Base64 it is a fixed short length. A “secret” that round-trips through Base64 Encoder and grows or shrinks with the input was never a hash and never a cipher. Code review can catch Buffer.from(apiKey).toString('base64') in a committed .env example in one glance.

Homework that says “decrypt this Base64” means decode. If the next layer is a real cipher, that is not a DevOkk page.

Source maps and “we hid the API host”

Shipping a production bundle with comments that contain Base64 “encrypted” endpoints is still a public endpoint list. Decode locally if you must debug; then stop committing costumes. What not to paste.

Base64 is a transport costume. Encryption is a lock. Hashing is a fingerprint. Use Base64 Encoder to change clothes, not to hide the keys. The companion how-to is the encode/decode guide; this page is so you stop calling it decrypt.

Frequently asked questions

Is Base64 encryption?

No. Base64 is encoding: a reversible mapping from bytes to a limited alphabet. Anyone can decode it. Encryption needs a key. Hashing is one-way and is not encryption either.

Why do APIs and JWTs use Base64 then?

To put binary or JSON into text-safe channels (headers, URLs, JSON strings). JWTs use Base64url on the header and payload so they travel as ASCII. Those parts are still readable. See What is a JWT?.

If I Base64 my API key, is it hidden in Git?

No. Secret scanners and humans decode it in one click. Use a secrets manager. Base64 Encoder will decode it as fast as it encoded it.

Does DevOkk send the string to encode it?

No. Base64 Encoder is built to run in the browser. Still do not paste production keys into any website if policy forbids it - including a local tab on a shared laptop.

What about Base64 of a password in a config?

Still a password. Encoding is not hashing. For password storage you want a slow keyed hash (bcrypt/argon2) in your app, not Base64, and not MD5 - MD5 vs SHA-1 vs SHA-256.

Base64 vs Base64url?

Same idea. URL-safe variant swaps +// and often drops padding so the string survives query strings. JWTs use Base64url. A decoder must accept the variant you actually have.

More reading that links back to the same tools and workflows.