Encode plain text to Base64, a binary-to-text scheme defined in RFC 4648. Base64 represents arbitrary byte sequences using 64 ASCII characters (A–Z, a–z, 0–9, +, /) plus optional padding (=).
How encoding works
Input text is first converted to bytes (UTF-8 by default in this tool). Every group of three bytes (24 bits) is split into four 6-bit indices, each mapped to a Base64 alphabet character. If the input length is not a multiple of three, padding characters are appended so the output length is always a multiple of four.
Common use cases
- Embedding small binary payloads in JSON, XML, or email (MIME)
- Data URLs in HTML/CSS (
data:text/plain;base64,...) - Storing credentials or tokens in configuration files (always treat encoded data as sensitive—it is not encryption)
- Debugging API responses that return Base64-encoded fields
Limitations
Base64 expands payload size by roughly 33%. It provides no confidentiality—anyone can decode it instantly. For secrets, use proper encryption (AES, TLS) instead. Very large inputs may be slow in the browser; consider chunking for multi-megabyte files.
Example
The string Hello encodes to SGVsbG8= (five bytes → eight characters with one padding symbol).