Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back to readable text.
Base64 shows up in data URLs, email attachments, JWTs and API payloads, yet many people only know it as 'that long string'. Here is what it actually does.
Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters: A to Z, a to z, 0 to 9, plus + and /. The trailing = signs are padding. The result is text that can travel through systems that only accept text without being corrupted.
Many protocols were designed around text: email bodies, JSON strings, URL query parameters, XML documents. If you drop raw binary into those channels, a byte such as 0x00 or a newline can terminate the message or be silently transformed. Base64 avoids that by using only characters that are safe in every text context.
Every three bytes of input become four characters of output, so Base64 makes data roughly 33% larger. That is the trade you make for safety: a 3 MB image becomes about 4 MB of text. For large files, prefer uploading the binary directly over encoding it.
data:image/png;base64,... embeds a small image directly in CSS or HTML.Anyone can decode it in one step. Never treat Base64 as protection for passwords, tokens or private data. If you need confidentiality, encrypt first, then encode.
Standard Base64 uses + and /, which have meaning in URLs. The URL-safe variant replaces them with - and _ and can drop the padding. When you build a query string by hand, use the URL-safe form or percent-encode the result.
Use the Base64 encoder and decoder to convert text in both directions, and the URL encoder when the output is going into a link.