Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text instantly. Free, fast and fully in-browser.
How to use the Base64 Encode / Decode
- 1Pick your direction using the Encode / Decode toggle at the top of the tool.
- 2Paste or type your content into the input box, plain text to encode, or a Base64 string to decode.
- 3The result appears instantly in the output field as you type, no submit button or page reload needed.
- 4If decoding fails, check for extra spaces or line breaks and remove them, or enable the URL-safe option if your string uses - and _ instead of + and /.
- 5Click the Copy button to grab the result, or use Download to save longer output as a text file.
- 6Press Clear or Swap to reset the fields or feed the output straight back in for a reverse conversion.
About the Base64 Encode / Decode
Base64 Encode Decode converts plain text into Base64 and turns Base64 strings back into readable text, all inside your browser. Base64 is an encoding scheme that maps binary data onto 64 safe ASCII characters (A-Z, a-z, 0-9, plus + and /), padding the output with = signs when the input length is not a multiple of three bytes. Every three bytes of input become four Base64 characters, which is why encoded output is always about 33% larger than the original. This tool uses the browser's native btoa and atob routines (with proper UTF-8 handling via TextEncoder/TextDecoder) so multibyte characters like emoji, accented letters, and Cyrillic survive the round trip intact. Because everything runs client-side in JavaScript, nothing you type or paste is ever uploaded to a server, logged, or stored. You can even disconnect from the internet after the page loads and it keeps working. Real-world uses are everywhere: embedding a small image as a data URI in CSS or HTML, encoding credentials for an HTTP Basic Authorization header, inspecting the payload of a JWT, wrapping binary attachments for email (MIME), passing JSON safely through URL parameters, or storing config blobs that must remain plain ASCII. Developers debugging APIs, sysadmins reading tokens, students learning how encoding works, and anyone who received a mysterious "SGVsbG8=" string all benefit. A practical tip: Base64 is encoding, not encryption, so never treat it as a way to hide secrets, anyone can decode it in one click. If decoding fails, the input usually contains stray whitespace, line breaks, or URL-safe characters (- and _) that need converting back to + and /. For binary files, encode the raw bytes rather than a text interpretation to avoid corruption.
Frequently asked questions
Does Base64 encoding encrypt or secure my data?
No. Base64 is a reversible encoding, not encryption. Anyone can decode a Base64 string instantly with no key, so never use it to hide passwords, API keys, or sensitive data. Use real encryption (like AES) or hashing for security.
Why is my decoded text showing garbled characters or question marks?
That usually means the original data was UTF-8 with multibyte characters. This tool decodes with proper UTF-8 handling, but if the string was encoded by a tool that only handled raw bytes, non-ASCII characters can break. Also make sure you did not accidentally copy extra whitespace or truncate the string.
Can I encode images or other binary files here?
This tool is optimized for text. You can paste the text content of a file, but for true binary files (images, PDFs) you need the raw bytes read via a file upload, since pasting a binary as text corrupts it. If the tool offers a file-upload button, use that; otherwise encode small assets and expect the output to be about 33% larger than the source.
What are those = signs at the end of Base64 output?
They are padding. Base64 processes input in 3-byte groups that map to 4 characters. When the final group has only 1 or 2 bytes, one or two = characters pad the output to a multiple of four. They are a normal, valid part of the encoding and are required for correct decoding.
My Base64 uses - and _ instead of + and / — will it decode?
That is the URL-safe Base64 variant, used in JWTs and URL parameters. Standard decoding expects + and /. Enable the URL-safe option if available, or manually replace - with + and _ with / before decoding. The tool handles the padding difference automatically in URL-safe mode.
Related tools
Browse all free online tools in Text tools and more.
Frequently asked questions
Does it handle Unicode?+
Yes — UTF-8 text is encoded and decoded correctly.