Base64 Encoder & Decoder
Nothing you type or upload here is sent anywhere — encoding and decoding both run entirely in your browser.
How Base64 encoding actually works
Base64 converts arbitrary binary data into a sequence of 64 printable ASCII characters
(A–Z, a–z, 0–9, +, /), so binary content can safely travel through
systems built for text — email bodies, JSON fields, URLs, or data URIs in HTML/CSS. It groups
input into 3-byte chunks and re-maps each into four 6-bit characters, which is why encoded
output is roughly 33% larger than the original.
What's the difference between standard Base64 and Base64URL?
Standard Base64 uses + and /, both of which have special meaning inside
a URL. Base64URL swaps them for - and _ and typically drops the
= padding, so the result can be dropped directly into a URL path or query string
without extra escaping — this is the variant used inside JWTs.
Why does decoding sometimes fail?
Base64 strings must have a length that's a multiple of 4 once padding is accounted for, and may only contain the valid alphabet for the mode you're using. A truncated string, stray whitespace, or mixing standard and URL-safe characters in the same string are the most common causes of a decode error — this tool reports which of those it detects.
Is this safe for encoding secrets or tokens?
Base64 is an encoding, not encryption — anyone with the encoded string can decode it instantly. It's safe to use this tool on secrets in the sense that the string never leaves your browser while you're using it, but the encoded output itself provides no confidentiality once you paste it somewhere else.