How to Encode and Decode Base64 (Free, No Upload)
Learn how to encode and decode Base64 in your browser. Understand what Base64 is, when to use it, and why it is not encryption. No uploads, no accounts.
The short answer
Paste your text into the Base64 tool, click Encode to convert to Base64, or Decode to convert back. Everything runs in your browser — your data never leaves your device.
Why this matters: Base64 is everywhere — in API tokens, data URLs, email attachments, and JWT headers. But it's not encryption. Anyone can decode it. This guide explains what Base64 actually is, when to use it, and why "Base64-encoded password" is a security anti-pattern.
What is Base64?
Base64 is a binary-to-text encoding scheme. It takes any binary data (images, files, bytes) and converts it into a string of 64 printable ASCII characters: A-Z, a-z, 0-9, +, and /.
Why 64 characters? Because 64 = 26, so every Base64 character represents exactly 6 bits. Three bytes (24 bits) become four Base64 characters. This is why Base64 increases size by ~33%.
When to use Base64 (4 common cases)
1. Data URLs (inline images)
data:image/png;base64,... — this is how you embed small images directly in HTML or CSS without separate files. Useful for icons, but avoid for large images (33% overhead + no caching).
2. API tokens and JWT
JWT tokens (eyJhbGciOi...) are Base64-encoded JSON. The header and payload are Base64URL (a variant of Base64 that uses - and _ instead of + and /).
3. Email attachments (MIME)
When you attach a file to an email, it's Base64-encoded by the email client. This is how binary attachments survive SMTP (which only handles 7-bit ASCII).
4. Basic Auth header
Authorization: Basic dXNlcjpwYXNz — username and password joined by : and Base64-encoded. Not secure over HTTP — only over HTTPS.
Base64 is NOT encryption (important)
This is the #1 misconception. Base64 is encoding, not encryption. It has no key, and anyone can decode it instantly.
Never use Base64 to "hide" passwords, secrets, or sensitive data. If you need encryption, use AES-256. If you need hashing, use bcrypt or Argon2. Base64 is for transport, not protection.
How to encode and decode (3 steps)
Step 1: Paste your text
Paste plain text to encode, or Base64 string to decode. The tool auto-detects the mode.
Step 2: Click Encode or Decode
Encode converts text → Base64. Decode converts Base64 → text. Both run instantly.
Step 3: Copy the result
Copy the result with one click. No uploads — everything is local.
Interesting facts about Base64
- Base64 is older than the Web. It was introduced in 1987 in RFC 989 (Privacy Enhancement for Electronic Mail) — 4 years before the first website.
- The "Base" in Base64 means 64 characters. Similar schemes exist: Base32 (less efficient), Base16 (hex), Base85 (more efficient but less compatible).
- Base64URL is a variant. Standard Base64 uses
+and/, which break URLs. Base64URL replaces them with-and_. - "==" is padding, not data. When the input length isn't a multiple of 3, Base64 adds
=or==at the end to make the output a multiple of 4.
FAQ
Is Base64 encryption?
No. Base64 is encoding. Anyone can decode it. Never use it to protect passwords or secrets.
Why does Base64 make data larger?
Base64 increases size by ~33%. Three bytes become four characters. This is the cost of converting binary to printable text.
What is Base64URL?
A variant that uses - and _ instead of + and /, so it works in URLs. Used in JWT and some APIs.
Is my data sent to a server?
No. Everything runs in your browser. Your text never leaves your device.
Can I decode Base64 from an image?
Yes — if it's a data URL (data:image/png;base64,...), you can decode it and save the bytes as an image. But Base64 is not an image format itself.
Related tools
- Base64 Encode / Decode — the tool from this guide.
- JSON Formatter — format, validate, and minify JSON.
- Hash Generator — SHA-256, MD5, and more.
If you need to encode or decode Base64 without uploading to a stranger's server — this is the tool. No account, no limits, no risk.
Encode or Decode Base64 →