Free Online Base64 Encoder & Decoder
Last updated: 2026-10-06
Quick answer: Encode text to Base64 or decode Base64 back to readable text. Our free Base64 converter handles both directions instantly — useful for developers embedding data in URLs, encoding credentials, debugging API payloads, and working with data URIs.
🔒 100% Private: Data never leaves your device.
✓ Free forever · ✓ No signup · ✓ Tool inputs stay in your browser — never sent to our servers.
How to Use the Base64 Encoder / Decoder
- Enter your text (to encode) or Base64 string (to decode).
- Click 'Encode to Base64' or 'Decode from Base64'.
- The result appears instantly in the output box.
- Copy it with one click.
Why Use Our Base64 Encoder / Decoder?
- Both directions — encode and decode in the same tool.
- Unicode-safe — correctly handles emoji and non-English text.
- Clear errors — invalid Base64 input gets a plain-English message, not silence.
- Private — conversion runs locally; nothing is transmitted.
Common Use Cases
- Data URIs: Embed tiny images or fonts directly in CSS/HTML to cut HTTP requests on small assets.
- Basic auth headers: Encode
username:passwordfor HTTP Authorization headers — always over HTTPS, since it's reversible. - API debugging: Decode opaque-looking tokens and payloads to inspect what's actually inside them.
- Email attachments: The original Base64 use case — MIME email still encodes attachments this way.
- Binary data in JSON: Smuggle images, files, or blobs through text-only configs and JSON APIs.
Base64 Encoder / Decoder vs Alternatives
- base64encode.org: A long-running online encoder with both directions and a huge charset menu — but your data is processed on their servers unless you switch on Live mode. Ours runs entirely in your browser: nothing is uploaded, encoding is Unicode-safe, and decoding is one click.
- Command line (base64 / certutil): Best for encoding whole files locally — no browser needed. Ours wins for quick text snippets and one-click decode of API payloads.
- Browser console (btoa / atob): Fine for a one-off, but atob() mangles Unicode without extra decoding steps. Ours is Unicode-safe out of the box.
For encoding files on your own machine, the command line is unbeatable. For quick text encode/decode work with proper Unicode handling and zero uploads, this page is the faster option — free, no signup, and your data never leaves the browser.
Frequently Asked Questions
What is Base64?
Base64 is a way to represent binary or text data using only 64 safe ASCII characters — commonly used in data URIs, email attachments, and API tokens.
Is Base64 encryption?
No. Base64 is encoding, not encryption — anyone can decode it. Never use it to 'protect' secrets.
Why did decoding fail?
The input probably isn't valid Base64 (wrong characters, bad padding, or line breaks). The tool will tell you.
Does it support Unicode and emoji?
Yes — text is UTF-8 encoded before conversion, so any language or emoji round-trips correctly.
Is this tool free?
Yes, free and unlimited with no account.
How do I encode an image to Base64?
Read the file's bytes and Base64-encode them, then use the result as a data URI —
<img src="data:image/png;base64,iVBOR...">. Note the ~33% size overhead: it's only worth it for small files (under ~10 KB) to save an HTTP request. For bigger images, link the file normally. This page encodes text; for image files, use a dedicated file-to-Base64 converter.What is Base64URL encoding?
A URL-safe variant that replaces
+ with -, / with _, and usually drops the = padding — because those characters are special inside URLs. JWT tokens use Base64URL; our jwt-decoder handles that variant automatically.Why is Base64 output bigger than the input?
Base64 packs 3 input bytes into 4 output characters — a fixed ~33% overhead, plus
= padding on the end. It's a transport encoding for binary-safe text channels, not compression; it never makes data smaller.How do I decode Base64 in code?
In Python:
base64.b64decode(s).decode("utf-8"). In browser JavaScript: atob(s) for ASCII (pair with a TextDecoder for Unicode). In Node.js: Buffer.from(s, "base64").toString("utf-8").Can Base64 contain line breaks?
Yes — MIME email wraps Base64 at 76 characters per line. This decoder ignores whitespace, so wrapped input decodes fine. The encoder always outputs a single unwrapped line, which works everywhere.
Is Base64 safe for passwords or API keys?
No. Anyone can decode Base64 instantly — it's an encoding, not encryption. Treat Base64 output like plain text: fine for transport, useless for secrecy.