Input
Output
How to Encode and Decode Base64 Online
- 1
Choose your mode
Select Encode to convert plain text or binary data into Base64, or select Decode to convert a Base64 string back to its original form. Toggle URL-Safe Mode if you need output suitable for URLs or filenames. - 2
Enter or paste your input
Type or paste your text into the input field. You can also click Upload File to load an image, document, or any binary file directly from your device. - 3
View the result instantly
The output appears in real time as you type. There is no submit button to press. The tool processes your input in your browser immediately, with zero server round-trips. - 4
Copy or download
Click Copy to place the result on your clipboard, or click Download to save it as a file. Use Swap to quickly reverse the direction and decode what you just encoded.
Common Use Cases
Embedding Images in CSS and HTML
Encoding API Credentials
Creating Data URIs
Email Attachments and MIME Encoding
Why use Base64 encoding?
Base64 is a binary-to-text encoding scheme defined in RFC 4648. It converts any binary data into a string of 64 printable ASCII characters: A-Z, a-z, 0-9, +, and /. The = character is used for padding when the input length is not a multiple of three bytes. This encoding is fundamental to how the modern web handles binary data in text-only contexts.
The encoding process works by taking three bytes (24 bits) of input and splitting them into four 6-bit groups. Each group maps to one of the 64 characters in the Base64 alphabet. Because 3 input bytes become 4 output characters, the encoded result is always roughly 33% larger than the original. A URL-safe variant replaces + with - and / with _ so the output can be used in URLs, cookies, and filenames without additional escaping.
Common applications include embedding images as data URIs in HTML and CSS, encoding binary attachments in email (MIME), transmitting credentials in HTTP Basic Authentication headers, and storing binary blobs in JSON or XML documents. Developers also use Base64 when working with JWT tokens, image-to-base64 conversion, and URL encoding. This tool processes everything in your browser. No data is ever sent to a server, making it safe for encoding API keys, tokens, and other sensitive strings during development.