How to Encode and Decode Base64
Base64 encoding converts binary data into ASCII characters, which makes it safe to embed in JSON, XML, HTML, or email bodies. Whether you need to encode an API key for a header or decode a data URI, this guide shows you how in seconds.
Try Base64 Encode/Decode Now
Free, no signup. Works in your browser.
Open the Base64 tool
Launch the Base64 Encode / Decode tool from the Encoding category. You will see two panels — input on the left and output on the right.
Choose Encode or Decode mode
Toggle between Encode and Decode at the top of the tool. Encode mode converts plain text to Base64; Decode mode converts Base64 back to readable text.
Enter your data
Type or paste the string you want to convert in the input panel. For file encoding, drag and drop the file directly into the input area to read its binary content.
Review the output
The result appears instantly in the output panel. For encoded output, you will see a string of letters, digits, plus signs, and slashes. For decoded output, the original text is restored.
Copy the result
Click the copy button or use Ctrl+A / Cmd+A to select all text and copy it to your clipboard. You can also download the result as a text file.
Pro Tips
- *Base64 increases data size by roughly 33% — avoid encoding large files unless necessary.
- *Use Base64 to embed small images as data URIs in CSS: `background-image: url(data:image/png;base64,...)`.
- *Never use Base64 as encryption — it is an encoding, not a security mechanism.
- *When decoding JWT tokens, the payload is Base64url-encoded (uses - and _ instead of + and /).
Related Guides
How to URL Encode and Decode
Encode special characters for safe use in URLs or decode percent-encoded strings back to readable text. Handles UTF-8, query parameters, and full URIs.
How to Decode JWT Tokens Online
Decode and inspect JWT (JSON Web Token) headers, payloads, and signatures. Verify expiration, claims, and algorithm details without any libraries.
How to Generate Hash Values Online
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from text or files. Understand when to use each algorithm and their security implications.