Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to plain text.
About this tool
Base64 is a binary-to-text encoding scheme that represents arbitrary binary data using 64 printable ASCII characters — the uppercase letters A–Z, lowercase a–z, digits 0–9, and the characters + and /. Every 3 bytes of input are grouped together and encoded as 4 characters, which means Base64 output is always about 33% larger than the original data. The = character is used as padding to make the output length a multiple of 4.
Base64 is widely used wherever binary data must travel through channels designed for text. Common use cases include embedding images as data URIs in HTML and CSS (data:image/png;base64,...), encoding email attachments in MIME format, storing binary data in JSON or XML payloads, and encoding credentials in HTTP Basic Authentication headers (Authorization: Basic base64(user:password)).
The URL-safe variant of Base64 (sometimes written as Base64URL) replaces + with - and / with _ and omits the = padding. This variant is used in JWTs (JSON Web Tokens), OAuth tokens, and any context where the encoded string appears in a URL or filename, since + and / have special meanings in URLs. When working with JWTs, note that each of the three dot-separated segments is Base64URL-encoded independently.
Base64 encoding is reversible by design and provides no confidentiality. It is not encryption, not compression, and not a hashing algorithm. Anyone who sees a Base64 string can instantly decode it — the encoding is obvious from the character set and the trailing = padding. Never use Base64 to protect sensitive data. Its only purpose is to make binary data safe to transmit through text-only channels.
When decoding Base64, common errors include strings with incorrect padding (the length must be a multiple of 4 characters, or padding must be stripped for URL-safe variants), strings containing whitespace or newlines (PEM certificate files split Base64 into 64-character lines), and strings using the wrong alphabet (standard vs URL-safe). This tool accepts and normalizes all common Base64 variants.