Base64 encode / decode
Encode any binary file into standard Base64 text, or decode Base64 text back into the exact original bytes.
Working…
Questions people ask
- What does decode accept?
- Strictly the RFC 4648 alphabet with correct padding, plus ASCII whitespace that is counted and removed (spaces, tabs and line breaks). Anything else, such as a NUL, UTF-8 punctuation or a high byte, refuses the run with the line and byte offset of the first offender. Characters are never silently discarded.
- Is the missing padding tolerated?
- No. Decode requires the canonical padded form: '=' or '==' only at the very end, the payload plus padding a multiple of four characters, and an input one character over a multiple of four is always invalid. Strict padding is how the result stays round-trip exact.
- What is 'non-canonical' and why reject it?
- Some encoders set unused trailing bits (for example ab==, a form whose last character carries bits a true Base64 encoder could never emit). Decoding such a string can still produce bytes, so it looks fine, but it is not the canonical encoding of any payload. This tool re-encodes the decode and requires an exact match; anything else is reported as a diagnostic instead of decoded.
- Is my decoded file treated as something executable?
- Never. The decoded payload is opaque bytes: it is stored and returned untouched, with a generic content type, and it is never executed, sniffed, or reinterpreted. The download keeps your file's name with a -decoded suffix (the platform cannot guess the payload's "true" kind, and does not pretend to).
- Does the wrapped form decode the same?
- Yes. The 76-character wrapping (the MIME/RFC 4648 §3.1 shape) is presentation only: it contains the identical encoding plus line breaks, and the decoder accepts whitespace-bearing input, so both forms decode to the same bytes.
- What about empty files?
- Both directions succeed: encoding an empty file yields an empty Base64 artefact, and decoding empty text yields an empty file. A real transformation, honestly reported.