Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text instantly. Supports text and file input with live encoding and one-click copy.
Base64
Results update instantly as you type
Enter Values
Embed Code
Copy and paste this HTML snippet into any web page to embed this calculator directly.
<iframe src="http://127.0.0.1:54963/embed/engineering/base64-encoder-decoder?ref=embed" title="Base64 Encoder / Decoder" width="100%" style="max-width:600px; border:none; height:500px;" loading="lazy"></iframe>
Direct Link
Share this link to let others open the calculator in their browser.
The Formula
Base64 encodes binary and text data into a safe 64-character alphabet (A-Z, a-z, 0-9, +, /) for transmission over text-based protocols that might misinterpret binary data. It works by grouping input bytes into 24-bit chunks (3 bytes), splitting each chunk into four 6-bit values, and mapping each 6-bit value to one of 64 printable ASCII characters. If the input length is not a multiple of 3 bytes, = padding is added to make the output a multiple of 4 characters.
Variable Definitions
Input Text
The text to encode or the Base64 string to decode.
Encoded Output
Base64-encoded string (about 33% larger than input).
Decoded Output
Original text recovered from Base64 by reversing the encoding process.
How to Use This Calculator
- 1
Select Encode mode to convert text to Base64, or Decode mode to convert Base64 back to plain text.
- 2
Enter your input text in the text area — supports plain text, numbers, and special characters.
- 3
The encoded or decoded output appears instantly as you type or paste.
- 4
Use the Copy button to copy the result to your clipboard for use in code, emails, or configuration files.
- 5
Character counts show the size difference: the encoded output is roughly 4/3 the size of the original due to Base64 overhead.
Base64 encodes 3 bytes into 4 ASCII characters using a 64-character alphabet, adding ~33% overhead.
Understanding the Concept
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format using 64 safe characters (A-Z, a-z, 0-9, +, /), with = used for padding. It is commonly used for embedding images directly in HTML or CSS as data URIs (data:image/png;base64,...), encoding email attachments via MIME, storing binary data in JSON or XML, and transmitting credentials in HTTP Basic Authentication headers. Each 3 bytes of input becomes 4 Base64 characters, adding approximately 33% overhead. Because Base64 uses only safe printable ASCII characters, it is immune to character encoding issues and transmission corruption from control characters that binary data might contain. A common variant, Base64URL, replaces + and / with - and _ and omits padding, making it safe for use in URLs and filenames.
Frequently Asked Questions
Sources & References
Related Calculators
Reviews
No reviews yet. Be the first to share your experience with Base64 Encoder / Decoder.
Write a Review
