Skip to main content
Best Answer Hub logo Best Answer Hub.
Back to Playbooks
Best Answer Hub Playbooks · Developer Tools
Encoding, not hiding

Base64 Is Not Encryption

Base64 turns up everywhere, from data URLs to JWTs, and it is constantly mistaken for a way to hide data. Here is what it actually does, why it makes files bigger, why emoji sometimes break, and why a secret pasted into the wrong tool is not safe.

Text inany Unicode
Base64 outRFC 4648
Reversibleby anyone
0
text sent to any server when you encode here
Best Answer Hub
64
characters in the Base64 alphabet
RFC 4648
~33%
larger than the original after encoding
MDN, 2026
0
security it adds: Base64 is not encryption
CWE-261

Base64 is a way to represent binary data as plain text using a fixed set of 64 characters. It exists so that things like images, keys, and attachments can travel through channels that only understand text. The one thing it does not do is keep anything secret: Base64 is encoding, not encryption, and the Best Answer Hub Base64 Encoder and Decoder makes that plain while converting your text entirely in the browser, with nothing sent to a server.

This matters because Base64 is one of the most misunderstood tools in software. It looks scrambled, so people assume it hides data. It does not. Anyone can decode a Base64 string in one step, which is exactly why the standards bodies that define it are careful to call it an encoding. Understanding that difference is the whole game.

Start with the basics

What is Base64, actually?

Base64 is a binary-to-text encoding defined in the international standard RFC 4648 (IETF, 2006). It takes raw bytes and maps them onto a 64-character alphabet made of A to Z, a to z, 0 to 9, and the two symbols plus and slash, with the equals sign used as padding. The result is a string of safe, printable characters that survives systems built for text, such as email bodies, URLs, and JSON.

The Best Answer Hub Base64 Encoder and Decoder does this both ways: paste text and it returns the Base64 string, paste Base64 and it returns the original text. It runs on standard browser functions, so the conversion happens on your own machine, and it sits in the Best Answer Hub Developer Toolbox next to the JSON, JWT, and regex tools.

The big misconception

Is Base64 encryption?

No, and this is the single most important thing to understand about it. Encryption uses a secret key to scramble data so only someone with the key can read it. Base64 uses no key at all: it is a fixed, public transformation that anyone can reverse instantly. Encoding a password in Base64 hides it from nobody. The security community is blunt about this. The weakness catalog CWE-261 states that "obscuring a password with a trivial encoding does not protect the password," and calls out Base64 by name, noting that anyone with access to the file "can read the value and easily determine that the value has been base 64 encoded" (MITRE CWE-261).

 Base64 encodingEncryption (e.g. AES)
PurposeRepresent binary as safe textKeep data secret
Needs a secret keyNoYes
Reversible by anyoneYes, in one stepNo, only with the key
Provides confidentialityNoYes
Typical useData URLs, email, tokens in transitProtecting data at rest or in flight
Base64 changes how data looks, not who can read it. If you can see the string, so can anyone else, in one step.
Where it earns its keep

What is Base64 actually for?

Plenty of legitimate jobs, all of which are about moving binary safely through text, never about secrecy. It embeds images directly in HTML or CSS through data URLs, so a small icon can ship inline rather than as a separate request (MDN). It carries email attachments through mail systems that only handle text, using the MIME standard (RFC 2045). It encodes the user and password in an HTTP Basic Auth header, and it encodes the readable parts of a JWT. In every one of these, the data stays fully visible.

UseWhat Base64 does hereKeeps it secret?
Data URLsEmbeds an image or file as text in HTML or CSSNo
Email (MIME)Sends binary attachments through text-only mailNo
HTTP Basic AuthEncodes user and password into the headerNo, needs HTTPS
JWT header and payloadbase64url-encodes the claimsNo, readable by anyone
Binary in JSONStores raw bytes as a string valueNo

The Basic Auth case is the clearest lesson. The header is only Base64 of user:password, which is why MDN warns that it "offers no cryptographic security" and must run over HTTPS (MDN). The encoding is for transport, and the encryption comes from TLS underneath.

The size tax

Why does Base64 make data bigger?

Because it trades size for safety. Base64 takes every 3 bytes of input and represents them as 4 text characters, so the output is about a third larger than the original (MDN). That is the deal: you get a string that travels safely through text channels, at the cost of roughly 33% more bytes. It is why inlining a large image as a data URL can bloat a page, and why Base64 is best kept for small assets and short values.

Base64 output is about a third larger
100% Raw input ~133% Base64

Base64 encodes 3 bytes as 4 characters, so output is roughly 33% larger. Source: RFC 4648 (3-to-4 mechanism); MDN ("roughly a third larger").

Two flavors

What is base64url, and does it matter?

Standard Base64 uses plus and slash, but those characters have special meanings in URLs and file names, so RFC 4648 also defines a URL-safe variant called base64url that swaps plus for minus and slash for underscore, and usually drops the equals padding (RFC 4648, Section 5). It is the form used inside JSON Web Tokens and OAuth parameters, which is why a JWT is full of dashes and underscores rather than slashes.

The Best Answer Hub Base64 Encoder outputs standard RFC 4648 Base64, which covers most everyday encoding and decoding. When you need to read the base64url segments of a token, the Best Answer Hub JWT Decoder handles the character substitution and padding automatically, so you do not have to convert by hand.

The emoji trap

Why do some tools turn my emoji into garbage?

Because they use an old method that assumes every character is a single byte. The browser has two built-in helpers, btoa to encode and atob to decode, but by design they only accept characters in the 0 to 255 range, so passing an emoji or a Chinese character straight to btoa throws an error or, in older tools, corrupts the text into mojibake (MDN). Many web converters were built on the long-deprecated escape function, which mangles anything outside Latin-1.

The Best Answer Hub Base64 Encoder avoids that trap by pairing btoa and atob with the modern TextEncoder and TextDecoder APIs, which convert text to and from UTF-8 correctly first. The upshot is that emoji, mathematical symbols, and right-to-left scripts like Arabic and Hebrew all round-trip exactly, with no garbled output.

The privacy angle

Should you paste a token or key into an online Base64 tool?

Only into one that runs on your device. Many online converters send whatever you paste to a server to process it, which means a token, a private key, or a config snippet has just been handed to a third party. Because Base64 adds no protection, that data arrives fully readable. Regulators frame the safe habit simply: the FTC advises not collecting or holding sensitive data you do not need (FTC), and the cleanest way to honor that is to never transmit the data at all.

The Best Answer Hub Base64 Encoder uses only the browser local btoa and atob functions, so your input never leaves the page. You can prove it by opening the network tab in developer tools and watching for zero outgoing requests as you encode, or by switching off the internet after the page loads. For anything sensitive, that is the difference between a private conversion and an accidental leak.

A word on unknown tools

The risk is not hypothetical. In 2025 the FBI warned that fake free online tools were being used to harvest data from what people pasted or uploaded, including passwords and banking details (BleepingComputer, 2025). A tool that processes everything locally, and receives nothing, removes that exposure.

Convert without sending a thing

Encode or decode Base64 in your browser

Full Unicode and emoji support, standard RFC 4648 output, and zero data sent to any server. Free, no signup, works offline.

Open the Base64 tool
Good questions

Common questions about Base64

What is the Best Answer Hub Base64 Encoder and Decoder?
The Best Answer Hub Base64 Encoder and Decoder is a free, browser-based tool that converts text to Base64 and decodes Base64 back to text. It supports full Unicode, including emoji and non-Latin scripts, and runs entirely on your device using standard browser functions, so nothing is uploaded and there is no signup.
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It uses no key and is a fixed, public transformation that anyone can reverse in one step. Encryption uses a secret key to keep data unreadable without it. Base64 only changes how data is represented, so it provides no confidentiality at all.
Can I use Base64 to hide a password or secret?
No, and it is a known security mistake. The weakness catalog CWE-261 states that obscuring a password with Base64 does not protect it, because anyone can decode it instantly. Use real encryption or a secrets manager for anything that must stay private. Base64 is for transport, never for secrecy.
What is Base64 actually used for?
Moving binary data through channels that only handle text. It embeds images in HTML or CSS via data URLs, carries email attachments through the MIME standard, encodes HTTP Basic Auth headers, and encodes the readable parts of a JWT. In each case the goal is safe transport, not keeping the content secret.
Why does Base64 make data about a third larger?
Because it represents every 3 bytes of input as 4 text characters, which adds roughly 33 percent to the size. That is the trade for a string that survives text-only systems. It is why Base64 suits small assets and short values, and why inlining a large image as a data URL can bloat a page.
What is the difference between Base64 and base64url?
base64url is a URL-safe variant defined in RFC 4648 that replaces the plus with a minus and the slash with an underscore, and usually drops the equals padding. It is used in JWTs and OAuth parameters. The Best Answer Hub Base64 Encoder outputs standard Base64, and the JWT Decoder reads base64url segments.
Why do some tools turn my emoji into garbage?
Because they use the browser btoa function, or the deprecated escape function, which assume every character is a single byte and cannot handle Unicode. The Best Answer Hub Base64 Encoder pairs btoa and atob with the modern TextEncoder and TextDecoder, so emoji and non-Latin scripts round-trip exactly with no mojibake.
Is it safe to paste a token or key into an online Base64 tool?
Only if the tool runs on your device. Many converters send what you paste to a server, which hands a token or key to a third party in fully readable form, since Base64 adds no protection. The Best Answer Hub Base64 Encoder processes everything locally, so nothing is transmitted.
How do I encode text to Base64?
Paste your text into the input area of the Best Answer Hub Base64 Encoder and click Encode. The tool converts it to a Base64 string using UTF-8 and shows the result, ready to copy. For example, the text Hello World becomes SGVsbG8gV29ybGQ equals. The whole conversion happens in your browser.
How do I decode Base64 back to text?
Paste the Base64 string into the Best Answer Hub Base64 Encoder and click Decode. The tool validates the string, adds padding if needed, and converts it back to readable text using UTF-8. If the input is not valid Base64, it shows a clear error rather than returning garbled characters.
Why does a Base64 string end with one or two equals signs?
Because Base64 works in groups of 4 characters, and the equals sign is padding used when the input does not divide evenly into 3 bytes. One trailing byte produces two equals signs, and two trailing bytes produce one. The base64url variant used in tokens usually omits this padding entirely.
Can anyone read a JWT because it is Base64?
Yes, for a standard signed token. A JWT header and payload are base64url-encoded, not encrypted, so anyone can decode and read the claims. Signing only proves the token was not tampered with, not that it is private. Never put a secret in a JWT payload unless the token itself is encrypted.
Does the Base64 tool work offline?
Yes. The Best Answer Hub Base64 Encoder is built with the browser own functions and needs no server, so after the page loads once it works with no internet connection. That makes it dependable for sensitive data in restricted or air-gapped environments, where nothing should be sent out.
How is this different from the browser btoa and atob functions?
The raw btoa and atob functions only handle single-byte characters and corrupt emoji or non-ASCII text. The Best Answer Hub Base64 Encoder wraps them with TextEncoder and TextDecoder for full Unicode support, and adds copy, clear, and clear error messages. For plain ASCII, btoa works fine, but for real-world text this is safer.
Is the Best Answer Hub Base64 tool free?
Yes, completely free with no signup, no usage limits, and no ads. It runs on client-side JavaScript in your browser, so there are no server costs to pass on and no account to create. Your text stays on your device from start to finish.
People also read

Keep going

Sources

Jump into the tools: Base64 Encoder, JWT Decoder, JSON Formatter, and the Developer Toolbox.

Built & maintained by Shahbaz Ali Malik Last updated: