These four encodings all do the same basic thing — represent data as plain text — but exist for different reasons and show up in different contexts. Here's what each one is actually for.
Base64
Base64 turns any data (including binary data like images) into a string using only 64 safe, printable characters (A-Z, a-z, 0-9, +, /). It's the standard way to embed binary data somewhere that only accepts text — email attachments (MIME), data URIs in CSS/HTML (data:image/png;base64,...), and HTTP Basic Authentication headers all use it.Base64 is not encryption — it's fully and instantly reversible by anyone, with no key required. Never rely on it to hide sensitive data.
URL encoding (percent-encoding)
URLs can only safely contain a limited set of characters. URL encoding replaces anything outside that set — spaces, &, ?, #, non-ASCII characters — with a % followed by the character's hex byte value (a space becomes %20). This is essential any time user input or dynamic text becomes part of a URL query string or gets submitted through an HTML form.
Hex encoding
Hexadecimal represents each byte as two characters (00 through FF), which is why it shows up constantly in contexts tied directly to raw bytes: color codes (#FF5733), cryptographic hashes (MD5, SHA-256 output), MAC addresses, and low-level debugging where you need to see exactly what bytes are in a piece of data.
Binary encoding
Binary spells out each byte as eight literal 1s and 0s — the actual bits. It's rarely used in real systems (hex says the same thing far more compactly) but it's the clearest way to actually see how character encoding works at the lowest level, which makes it useful for learning or teaching, even if you'd never use it in production code.
Common mistakes
- Treating Base64 as security. It isn't — see above. If you need confidentiality, use real encryption, not encoding.
- Forgetting to URL-encode dynamic values in a query string, which silently breaks the URL the moment the value contains a space,
&, or other reserved character. - Assuming hex is case-sensitive. It isn't —
FFandffrepresent the identical byte. - Mixing up which format you're decoding. Pasting a hex string into a Base64 decoder (or vice versa) will either error out or produce garbage — always match the decode format to how the text was actually encoded.
Frequently asked questions
Is Base64 encryption? Is it safe for passwords or secrets?
No — Base64 is not encryption, it's just a different way of representing the same data. Anyone can decode Base64 back to the original text instantly, with no key or password required (this tool does it with one click). Never use Base64 as a substitute for actual encryption, and never assume Base64-encoded text in a URL, cookie, or config file is "hidden" — treat it as fully readable plain text, because it is.
Why does my Base64 string end with = or == signs?
Base64 encodes data in 3-byte chunks, converting each chunk into 4 characters. When your input length isn't a multiple of 3 bytes, the last chunk is padded, and = signs mark that padding. One = means the last chunk had 2 bytes, == means it had 1 byte. This is normal and expected — not an error.
What's the difference between hex and binary encoding?
Both represent the same underlying bytes, just in different number bases. Hex (base 16) uses two characters per byte (00-FF), making it compact and common in color codes, hashes, and memory addresses. Binary (base 2) uses eight characters per byte (00000000-11111111), spelling out the actual bits — more useful for learning how character encoding works at the bit level than for everyday use.
When should I URL-encode text?
Whenever text is going into a URL query string, a form submission, or anywhere the URL specification reserves certain characters (spaces, &, ?, #, /, and others). Without encoding, those characters can break the URL structure or get interpreted as a separator instead of literal content. Encoding replaces them with a % followed by their hex byte value.
Why did decoding fail with an error?
Each format has strict rules: Base64 only uses A-Z, a-z, 0-9, +, /, and = padding — any other character means it isn't valid Base64. Hex needs an even number of hex digits (0-9, A-F). Binary needs groups of 0s and 1s. If you paste text that was encoded differently than you selected, or partially corrupted text, decoding will fail — that's expected behavior, not a bug in the tool.