Menu

Base64 Obfuscator

Complete Base64 toolkit with 8 reversible modes. Standard, URL-safe, file-to-data-URI, XOR, and multi-layer encoding. Honest about what it can and cannot do.

Base64 Encoding Studio 8 Modes
Ready
Input 0 lines • 0 chars
Output 0 lines • 0 chars
🔤 Standard Encode mode. Converts text to standard Base64 (RFC 4648). Output uses + and / with = padding. 3 bytes in → 4 chars out (33% larger).
Important Security Notice: Base64 is an encoding format, not encryption. It does not protect passwords, API keys, or other sensitive information. XOR and multi-layer encoding are also reversible and should not be used as substitutes for secure encryption. Use a standard authenticated encryption algorithm when confidentiality is required.
Complete Guide to Base64 Encoding

What Base64 Actually Is

Base64 is a binary-to-text encoding standardized in RFC 4648. It converts arbitrary binary data into a restricted 64-character ASCII alphabet:

A-Z (26), a-z (26), 0-9 (10), + (1), / (1) = 64 characters total

The = character is used as padding. Every 3 bytes of input become 4 characters of output — a 33% size increase.

Why Base64 Exists

Many protocols only accept printable ASCII: email, JSON, XML, URLs, HTTP headers, HTML attributes. Binary data (images, PDFs, certificates, encryption keys) contains control characters and bytes above 127 that break these protocols. Base64 solves this by representing binary data as ASCII-safe characters.

Base64 Is Not Encryption

Base64 provides zero security. It is reversible by design. Anyone can decode a Base64 string using atob() in any browser console, base64 -d on the command line, or hundreds of online tools. Base64 is often confused with encryption because the output looks random, but it is pure encoding — there is no key, no secrecy, no protection.

The Nine Modes

ModeInputOutputReversible?
🔤 Standard EncodePlain textBase64 (RFC 4648)✅ Via Decode
🔓 Standard DecodeBase64Plain text✅ Via Encode
🔗 URL-Safe EncodePlain textBase64URL (RFC 4648 §5)✅ Via URL Decode
🔓 URL-Safe DecodeBase64URLPlain text✅ Via URL Encode
📁 File to Data URIFile uploaddata:mime;base64,...✅ Via browser
🔐 XOR + Base64 EncodePlain text + keyBase64(XOR(text, key))✅ Via XOR Decode
🔓 XOR + Base64 DecodeXOR-Base64 + keyPlain text✅ Via XOR Encode
🔄 Multi-Layer EncodePlain text + keyBase64(XOR(Base64(XOR(text, key)), key))✅ Via Multi-Layer Decode
🔓 Multi-Layer DecodeMulti-layer + keyPlain text✅ Via Multi-Layer Encode

Standard vs URL-Safe Base64

Standard Base64 uses + and /. Both characters have special meaning in URLs:

  • + is interpreted as a space in query strings
  • / is a path separator

Base64URL (RFC 4648 §5) replaces them with URL-safe characters:

StandardURL-Safe
+- (hyphen)
/_ (underscore)
= paddingoptional (may be omitted)

Use URL-Safe mode when embedding Base64 in URLs, filenames, cookies, or JWT tokens.

XOR + Base64 — Exact Algorithm

This mode applies an XOR transformation before Base64 encoding:

Encode:
1. Take input text bytes: b[0], b[1], b[2], ...
2. For each byte i, XOR with key byte (i mod keyLength): x[i] = b[i] ^ key[i % keyLength]
3. Base64-encode the resulting byte array

Decode:
1. Base64-decode the input to get bytes
2. For each byte i, XOR with key byte (i mod keyLength)
3. Convert back to UTF-8 text
XOR is not secure encryption. It is a reversible transformation. Anyone who knows the key can decode it. Even without the key, if an attacker has any known plaintext (e.g., they know the first few bytes of your message), they can recover the key and decrypt the rest. XOR provides obfuscation, not protection.

Multi-Layer — Exact Algorithm

This is a custom composite transformation, clearly defined as:

Encode:
1. XOR-encode the input text with the key → XOR1
2. Base64-encode XOR1 → B64_1
3. XOR-encode the B64_1 string with the key → XOR2
4. Base64-encode XOR2 → B64_2 (final output)

Decode:
1. Base64-decode B64_2 → XOR2
2. XOR-decode XOR2 with the key → B64_1
3. Base64-decode B64_1 → XOR1
4. XOR-decode XOR1 with the key → original text

The decoder must apply these four steps in exact reverse order of the encoder. This tool does that, and it verifies the round-trip after encoding.

Security note: Multi-layer does not increase security. It only increases obfuscation depth. An attacker who knows the algorithm can reverse the entire chain in seconds. Anyone with a known plaintext attack can recover the key from the first XOR layer.

File to Data URI

Data URIs let you embed a file directly in HTML or CSS without a separate HTTP request:

<img src="data:image/png;base64,iVBORw0KGgoAAAA...">

Supported formats: any file. The browser determines the MIME type based on the file extension or content. Common uses:

  • Small icons and logos in CSS to reduce HTTP requests
  • Inline images in email
  • Self-contained HTML documents
  • SVG fonts

Size warning: Base64 encoding increases file size by 33%. Do not use data URIs for files above ~10 KB — use regular URLs instead.

When to Use Each Mode

Use CaseRecommended Mode
Embed data in JSON/XML🔤 Standard Encode
Embed in URL query string🔗 URL-Safe Encode
Embed image in CSS/HTML📁 File to Data URI
Hide text from casual readers🔐 XOR + Base64
Add obfuscation layers🔄 Multi-Layer
Protect sensitive data❌ Not any of these modes — use real encryption

What Base64 Obfuscation Cannot Do

  • It cannot encrypt. Standard Base64 is reversible by anyone with zero effort.
  • It cannot protect API keys. Even XOR + Base64 is trivially reversible with the key (which must ship with the code) or via known-plaintext attack.
  • It cannot hide secrets from a determined reader. All modes are reversible transformations.
  • It cannot replace HTTPS. If you need confidentiality in transit, use TLS.
  • It cannot replace password hashing. Use bcrypt, Argon2, or scrypt for passwords.
  • It cannot replace encryption at rest. Use AES-GCM, ChaCha20-Poly1305, or a secrets manager.

When You Actually Need Encryption

If you need confidentiality — for real, not cosmetic — use:

  • AES-256-GCM — authenticated encryption, standard for symmetric encryption
  • ChaCha20-Poly1305 — modern authenticated encryption
  • GPG or age — file-level encryption for storage and transfer
  • HTTPS/TLS — encryption in transit
  • bcrypt, scrypt, or Argon2 — password hashing (one-way)
  • AWS Secrets Manager, HashiCorp Vault — secret storage with access control and rotation

Base64 and XOR are not substitutes for any of these.

Frequently Asked Questions

Is Base64 encryption?
No. Base64 is a reversible encoding. Anyone can decode it. It provides zero security.
Can I use Base64 to hide API keys in my frontend code?
No. Base64 is trivially decoded in DevTools. Never put API keys in frontend code — use a backend proxy or short-lived tokens.
What is the difference between standard and URL-safe Base64?
Standard uses + and /. URL-safe uses - and _. Use URL-safe for URLs, cookies, filenames, and JWTs.
Is XOR + Base64 more secure than Base64?
No. Both are reversible. XOR only adds a small amount of obfuscation. It is not secure encryption. Do not use it for confidential data.
What is multi-layer encoding?
A custom composite: XOR → Base64 → XOR → Base64. It adds obfuscation layers but does not add security. The decoder must apply the exact reverse sequence.
Will the tool verify round-trip decoding?
Yes. For XOR and multi-layer modes, the tool decodes the output and verifies that it matches the original input byte-for-byte. The results panel shows PASS or FAIL.
Does Base64 increase file size?
Yes. Base64 encoding increases size by 33% (4 chars output per 3 bytes input).
What is a data URI?
A data URI embeds a file inline in HTML or CSS as data:mime;base64,.... Useful for small icons and logos to reduce HTTP requests.
Is my data uploaded to your server?
No. Everything runs in your browser using JavaScript. Your data never leaves your device.
Can I use Base64 for JWTs?
JWTs use Base64URL for header and payload. The signature is not encryption — it is a cryptographic signature. Never put secrets in JWT payloads; they are readable by anyone.
What is the maximum file size for data URI encoding?
Theoretically no limit, but browser performance degrades above 10 MB. Data URIs are inefficient — use regular URLs for files above ~10 KB.
Does Base64 support binary data?
Yes. Base64 works on any bytes, including binary. The tool's file upload mode supports images, PDFs, ZIPs, and any other file type.
What should I use for real encryption?
AES-256-GCM, ChaCha20-Poly1305, GPG, or age. Never Base64, XOR, or ROT13.
Is Base64URL the same as Base64?
Base64URL is a variant of Base64 that uses URL-safe characters (- and _ instead of + and /). The padding may be omitted.
Can Base64 hide malware?
Base64 is sometimes used to encode malware payloads, but this does not hide the malware from antivirus. Encoded malware is still malware. Do not use Base64 to bypass security scanners.

Related Tools