Base64 Encode / Decode
Encode text or files to Base64 and decode Base64 strings back to plain text instantly.
How to Use
- Type or paste text in the Encode tab to convert it to Base64.
- Paste a Base64 string in the Decode tab to convert it back to text.
- Toggle "URL-safe" to use the URL-safe variant (replaces + → - and / → _).
- Upload a file to get its Base64 data URI.
When to Use This
- Embedding a small icon straight into a stylesheet saves an HTTP request, and the file tab yields the data URI ready for a background-image rule.
- Developers inspecting a Kubernetes secret or a CI variable can decode the stored value here to confirm its contents before changing anything.
- Reading an API response that returns a base64 payload is quicker than writing a throwaway decode script just to see the JSON inside.
- Passing a token or a binary blob through a query string calls for the URL-safe variant, produced here with the padding already stripped.
Frequently Asked Questions
About This Tool
Base64 takes three bytes at a time and rewrites them as four characters from a 64-symbol alphabet, which is why the output runs roughly a third longer than the input. It exists so binary data can travel through text-only channels such as mail headers, JSON fields and stylesheets. It is a transport encoding and nothing more: the transformation is public and reversible by anyone holding the string.
Text is converted to its UTF-8 bytes before the browser's btoa runs, so accented letters, CJK and emoji survive the round trip. The URL-safe option replaces plus with hyphen and slash with underscore and drops the trailing equals padding. Decoding translates hyphen and underscore back and restores padding, so it accepts both forms without a toggle and errors on input it cannot parse. The file tab reads your file locally and returns a full data URI.
Notes & Limits
- Base64 is encoding, not encryption; anyone holding the string can read it back, so it must never be used to protect a password or key.
- Output is about 33 percent larger than the input, which makes data URIs a poor choice for anything beyond small icons, fonts and sprites.
- The file tab returns a complete data URI that opens with data: the media type and base64, so strip that prefix when a system expects bare Base64.
- Files are read into memory and the result is rendered in a text box, so a large upload can leave the page unresponsive for a while.