When decoded text looks like garbage
Base64 decodes to bytes, and bytes only become letters once you pick an encoding. Three things usually go wrong:
- The text was not UTF-8. Latin-1 text with an accent, such as
é, is a single byte that is not valid UTF-8. Switch Show text as to Latin-1. Text from PowerShell encoded commands is UTF-16, which this tool treats as binary data until you choose UTF-16 as the text encoding. - It is not text at all. Images, PDFs and archives decode to bytes that were never characters. The tool shows the detected type and offers a download instead of a wall of symbols.
- It was Base64 twice. If the result is itself a Base64-looking string, paste it back in and decode again.
Base64 you will meet in the wild
- HTTP Basic authentication: the header
Authorization: Basic dXNlcjpwYXNzcarriesuser:passin Base64. This is why Basic authentication must always run over HTTPS. - JWTs: the first two parts of a token are URL-safe Base64 of JSON. To read them with a signature check and readable dates, use the JWT decoder.
- Data URLs:
data:image/png;base64,followed by Base64. Paste the whole thing and the prefix is understood. - API responses: files and images are often sent as Base64 strings inside JSON. If the string has backslashes before slashes (
\/), remove them first.
What the error messages mean
- Not part of the Base64 alphabet: a character such as a space inside a word, a quotation mark or a
%slipped in. The message says which character and where. - A remainder of 1: the text has one character too many or too few. Base64 length can only leave a remainder of 0, 2 or 3 when divided by 4, so the text was probably cut off.
- Padding in the middle:
=can only be at the very end. This usually means two Base64 strings were joined together.