Free tool
Encode and decode Base64 without mangling a single character
Live, UTF-8-safe Base64 conversion with auto-detect, emoji support, byte counts and precise error messages — entirely in your browser, nothing uploaded.
Base64 output
Everything runs locally in your browser — nothing you type or paste is uploaded, logged or stored anywhere.
How it works
Three steps, no signup
Paste or type
Drop in plain text or a Base64 string. Auto-detect works out the direction, or pin Encode / Decode yourself — conversion is live on every keystroke.
Check the counters
Character and byte counts update for both sides, so you can see exactly how much a payload grows (~33%) and confirm nothing was truncated.
Copy, swap or download
Copy the result, swap it back into the input to reverse the operation, or download it as a .txt — Ctrl+Enter copies, Ctrl+L clears.
Good to know
Three Base64 facts that save debugging time
First, Base64 is an encoding, not encryption. It exists so binary bytes survive text-only channels — email bodies, JSON strings, HTTP headers — and anyone can reverse it in milliseconds. If you find yourself “protecting” an API key by Base64-encoding it, you have hidden it from exactly nobody; secrets belong in a signed token or an encrypted store, never in reversible text.
Second, there are two alphabets. Standard Base64 uses “+” and “/”, while the URL-safe variant (RFC 4648 §5) swaps them for “-” and “_” so the string survives inside URLs and filenames — it is what JWTs use, which is why a JWT segment pasted here can flag “invalid character”. If your string contains dashes or underscores, translate them back to plus and slash (and restore the “=” padding) before decoding.
Third, size grows by a predictable third. Every 3 bytes of input become 4 characters of output, so a 30 KB image becomes ~40 KB of Base64 before it ever hits the wire. That overhead is why WhatsApp-style messaging APIs take media as uploads or URLs rather than inline Base64 — and why the byte counters in this tool show both sides of the conversion, so payload budgets are never a surprise.
FAQ
Frequently asked questions
What is Base64 and when is it used?
Base64 is a way of writing arbitrary bytes using only 64 safe characters (A–Z, a–z, 0–9, + and /), so binary data can travel through systems built for plain text. You meet it in data: URLs, email attachments, JSON payloads that embed files, Basic auth headers and webhook signatures. It is an encoding, not encryption — anyone can decode it, so never treat Base64 as a way to hide secrets.
Why do emojis and Hindi text break in some Base64 tools?
The browser's built-in btoa() only accepts Latin-1 characters, so anything outside that range — emojis, Devanagari, most non-English scripts — throws an error or silently corrupts. This tool first converts your text to UTF-8 bytes with TextEncoder and only then encodes, so “नमस्ते” and 🇮🇳 round-trip perfectly. Decoding does the reverse via TextDecoder.
How does auto-detect decide whether to encode or decode?
If the input is at least 8 characters, uses only the Base64 alphabet, has a length that is a multiple of 4 and actually parses, the tool decodes it; otherwise it encodes. Short words like “cat” are technically valid Base64 by accident, which is why the minimum length exists — and you can always force a direction with the Encode and Decode buttons.
Why is my Base64 string reported as invalid?
The three common causes are: a character outside the Base64 alphabet (often a stray quote or URL-safe -/_ variant), padding “=” appearing anywhere except the very end, and a length that is not a multiple of 4 — which almost always means the string was truncated in transit. The error message tells you exactly which rule failed and at which position.
Is it safe to paste sensitive data into this tool?
The conversion runs entirely in your browser with standard Web APIs — nothing is uploaded, logged or stored anywhere, and the page works offline once loaded. That said, decoded secrets on screen are still secrets: clear the tool before screen-sharing, and remember Base64 itself offers zero confidentiality.
More free tools
Keep your stack sharp
JSON Template Validator
Paste template JSON and catch structural errors before Meta review does.
Open toolWebhook Payload Formatter
Pretty-print and annotate WhatsApp webhook payloads for faster debugging.
Open toolTemplate Variable Checker
Lint {{n}} variables — gaps, duplicates and edge-position mistakes.
Open toolPhone Number Formatter
Convert phone numbers to E.164 — single numbers or whole lists.
Open toolReady to do this at scale?
InfiQ puts broadcasts, chatbots, a shared inbox and the developer API behind one dashboard — on the official WhatsApp Business API. 7-day free trial, no card required.
