🔐 Base64 Encoder / Decoder
Encode text to Base64 and decode it back — with full Unicode support, URL-safe mode, file-to-Base64 / data URI, validation and size stats. Free, instant & 100% private.
A Base64 Tool That Does It All
Text, files, Unicode, URL-safe output and clear stats — everything in one fast, private page.
Two-Way & Instant
Encode text to Base64 or decode it back, live as you type — with a one-click Swap to feed output into input.
Full Unicode (UTF-8)
Emoji and every language encode correctly, unlike the browser's raw btoa() which only handles Latin-1.
URL-Safe Mode
Switch to base64url (-_ instead of +/, no padding) for tokens, query strings and filenames.
File → Base64 / Data URI
Turn an image or any file into Base64 and a ready-to-paste data URI, all in your browser.
Validation & Stats
Invalid Base64 is flagged clearly, and a size chart shows exactly how much bigger or smaller your data gets.
Private & Free
100% client-side — nothing is uploaded. No login, no limits, dark mode, and fully responsive.
How to Use the Base64 Tool
Encode or decode in seconds — no upload, no submit button.
Pick Encode or Decode
Use the tabs to choose your direction. Toggle URL-safe if you need base64url output.
Enter your data
Type or paste text (or load a file). The result appears instantly in the box right below.
Check & copy
Review the size stats, then copy the output — or use Swap to send it back into the input.
Encode files too
Use 'Encode a file to Base64' to get a Base64 string or data URI for any image or document.
Frequently Asked Questions
What Base64 is, encoding vs decoding, why it isn't encryption, URL-safe mode, files, and the 33% size question.
What is Base64 encoding?
Base64 is a way to represent binary data (or text) using only 64 'safe' printable characters: A–Z, a–z, 0–9, plus + and / (with = for padding). It lets binary content travel safely through systems that were designed for text, like email and URLs. It's an encoding, not encryption.
How do I encode text to Base64?
Choose Encode, type or paste your text, and the Base64 appears instantly below. This tool encodes via UTF-8, so emoji and non-English characters convert correctly — something the browser's raw btoa() can't do on its own.
How do I decode Base64?
Choose Decode and paste the Base64 string. The original text appears immediately. If the input isn't valid Base64, you'll get a clear error so you can spot the problem. Whitespace and missing padding are handled automatically.
Is Base64 the same as encryption?
No — and this is the most common misconception. Base64 is reversible by anyone with no key or secret. It hides nothing; it merely repackages data into text-safe characters. Never use Base64 to 'protect' passwords or sensitive data.
Why is Base64 about 33% larger than the original?
Base64 represents every 3 bytes (24 bits) of input as 4 characters (each carrying 6 bits). That 4-for-3 ratio makes the output roughly one-third bigger. The size-comparison chart shows the exact change for your input.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs and filenames. URL-safe Base64 (base64url) swaps them for - and _ and usually drops the = padding, so the result is safe to drop into a URL, query string, or filename. Toggle 'URL-safe' to use it.
Can I convert a file or image to Base64?
Yes. Click 'Encode a file to Base64' and choose any file up to ~1.5 MB. You'll get its raw Base64 and a ready-to-use data URI you can paste straight into CSS or an <img> tag. Everything happens locally — the file is never uploaded.
Is it safe and private?
Completely. All encoding and decoding run in your browser using JavaScript — nothing is sent to a server. You can safely paste tokens or private text. It works on Chrome, Firefox, Safari, Edge and mobile browsers.