Data Formats
How to Decode Base64: Text, Unicode, Padding, and Common Errors
Decode Base64 text safely, understand padding and invalid-character errors, handle UTF-8 correctly, and learn why decoded data is not automatically trustworthy.
In this article
How to Decode Base64: Text, Unicode, Padding, and Common Errors
Base64 represents bytes using printable text characters.
Duck Cloud's Base64 Decoder decodes Base64 into Unicode text locally in your browser.
Encoding, not encryption
Base64 does not protect passwords, API keys, access tokens, or secrets. It is reversible encoding.
Padding
Standard Base64 may end in = or ==. Some systems omit padding while others expect it.
If decoding fails, identify the Base64 dialect before editing the string.
Base64URL
JWTs use Base64URL, a related URL-safe form. Use JWT Decoder for JWTs rather than assuming standard Base64 behavior.
Unicode
Base64 encodes bytes. To display decoded bytes as text, those bytes must be interpreted with a character encoding such as UTF-8.
This matters for Burmese text, emoji, accented characters, Japanese, Arabic, and other Unicode content.
Binary data
Not every Base64 value is text. It may represent an image, PDF, certificate, encrypted bytes, or compressed content.
Do not force arbitrary bytes into a text interpretation.
Invalid input
Failures can come from copied spaces, wrong alphabet, damaged data, truncated content, or surrounding JSON syntax.
Preserve the original before cleaning it.
Double encoding
Sometimes Base64 is encoded again. If one decode yields another Base64-looking value, do not keep decoding blindly. Understand the source protocol.
URL layers
Percent-decoding and Base64 decoding are separate operations. Use URL Decoder when the URL itself is encoded.
Security
Decoded content can still be malicious HTML, JavaScript, shell code, or executable bytes. Decoding data does not make it safe to run.
Identify the variant, preserve the original, decode once according to the protocol, and interpret the output using the expected content type.