Base64 Encoder / Decoder
Convert text to Base64 and back — UTF-8 safe, URL-safe variant included, everything in your browser.
What is Base64?
Base64 is an encoding scheme that represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /). It exists so binary content can travel safely through systems designed for plain text — HTTP headers, JSON payloads, XML, email bodies. You'll meet it constantly as a developer: Basic auth headers (Authorization: Basic base64(user:pass)), data URIs for inlining small images in CSS or HTML, JWT segments, and API payloads that embed files.
How this tool works
Encoding and decoding happen entirely in your browser using the standard btoa/atob primitives, wrapped with TextEncoder/TextDecoder so multi-byte UTF-8 text — emoji, Devanagari, Bengali, Chinese, anything — round-trips correctly (naive btoa throws on non-Latin characters). The decoder also accepts URL-safe Base64 (-/_ instead of +//) and repairs missing padding automatically.
FAQ
Is Base64 encryption?
No — this is the most common misconception. Base64 is an encoding, not encryption: anyone can decode it instantly (you just did). Never use Base64 to protect secrets; use real encryption, and keep secrets out of client-side code entirely.
Why is Base64 output ~33% larger than the input?
Base64 maps every 3 bytes of input to 4 output characters, so encoded data is 4/3 the size of the original (plus up to two = padding characters). That's the price of using only printable characters.
What is URL-safe Base64?
Standard Base64 uses + and /, which clash with URL syntax. The URL-safe variant (RFC 4648 §5) substitutes - and _ and usually drops the = padding — it's what JWTs and many APIs use. Toggle "URL-safe output" above to produce it.
Free tools are just the start
Deploy your next app on bare-metal cloud with per-second billing — your first app is free, no credit card required.
More free tools
Generate strong, random passwords with a cryptographically secure RNG — entirely in your browser.
Percent-encode strings for safe use in URLs, or decode %20-style sequences back to text.
Decode a JSON Web Token's header and payload, check expiry, and verify HS256 signatures.
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes of any text — instantly, in your browser.
Validate JSON with precise error locations, then pretty-print or minify it — with sorted keys if you like.
Strip comments and whitespace from HTML, CSS or JavaScript and see exactly how many bytes you saved.