Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 strings back to text.
A Base64 encoder/decoder converts text and binary data to and from Base64 encoding, commonly used in emails, URLs, and API authentication.
Examples
Encode "Hello, World!"
Decode "SGVsbG8="
Frequently Asked Questions
What is Base64 used for?
Is Base64 encryption?
Quick Tips
- •Base64 output is always about 33% larger than the input, so avoid encoding large files unnecessarily.
- •If you see trailing = or == in Base64, those are padding characters indicating the input was not a multiple of 3 bytes.
- •Use Base64 for embedding small images in CSS or HTML via data URIs, but serve larger assets as separate files for better caching.
A Base64 encoder/decoder converts text and binary data to and from Base64 encoding, commonly used in emails, URLs, and API authentication.
How to Use This Calculator
Select encode or decode mode and enter your text. Encode converts plain text to Base64 format. Decode converts a Base64 string back to plain text. Supports UTF-8 characters.
Understanding the Formula
Base64 encodes every 3 bytes of input into 4 ASCII characters using a 64-character alphabet (A-Z, a-z, 0-9, +, /). Encoded output is approximately 33% larger than the input. Padding (=) is added if the input length is not a multiple of 3.
Examples
Encode "Hello, World!"
Input: "Hello, World!" (13 chars). Output: "SGVsbG8sIFdvcmxkIQ==" (20 chars).
Decode "SGVsbG8="
Input: "SGVsbG8=" (8 chars). Output: "Hello" (5 chars).
Frequently Asked Questions
What is Base64 used for?
Base64 is used to encode binary data as ASCII text for transmission over text-based protocols. Common uses include email attachments (MIME), embedding images in HTML/CSS (data URIs), and encoding API tokens or credentials.
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It does not provide any security. Anyone can decode a Base64 string. For security, use proper encryption algorithms like AES.
Assumptions & Limitations
- Input text is treated as UTF-8; other encodings (e.g. Latin-1, UTF-16) may produce different Base64 output for the same characters.
- Standard Base64 alphabet (A-Z, a-z, 0-9, +, /) is used; URL-safe Base64 (replacing + with - and / with _) is not supported.
- Very large inputs may be limited by browser memory; this tool is intended for moderate-length strings, not multi-megabyte files.