Developer guide
How to decode Base64 into readable text
To decode Base64, identify the alphabet, validate the encoded characters and padding, convert each group back to bytes, then interpret those bytes with the correct character encoding.
Open the Base64 DecoderWhat Base64 decoding does
Base64 represents binary bytes with a restricted set of printable characters. Standard Base64 uses uppercase and lowercase letters, digits, +, and /. An equals sign can appear at the end as padding.
Decoding reverses that representation. It does not decrypt, decompress, or automatically make the result safe. The decoded bytes may be readable text, an image, an archive, or another binary format.
Base64 characters become decoded bytes, then UTF-8 text
The final text step succeeds only when the decoded bytes form valid UTF-8.
How to decode Base64 step by step
- Copy only the Base64 value. Remove surrounding quotation marks or a prefix such as
data:text/plain;base64,unless your decoder handles it separately. - Determine whether the value uses standard Base64 or Base64url.
- Paste the value into a decoder and choose the matching alphabet.
- Decode the value, then inspect the output before copying or using it.
- If decoding fails, check the alphabet, length, padding, and expected output type.
With the ToolPixels Base64 Decoder, spaces, tabs, and line breaks around encoded data are ignored. Valid unpadded input is accepted, while malformed padding and invalid decoded UTF-8 are reported.
A simple Base64 example
Consider this encoded value:
SGVsbG8sIFRvb2xQaXhlbHMh
Decoding it as standard Base64 produces:
Hello, ToolPixels!
Base64 output often ends in one or two = characters because each four-character block represents up to three bytes. Padding completes the final block when the original byte count is not divisible by three. Some unpadded formats omit it.
Standard Base64 and Base64url
Base64url is a URL-safe variation commonly used in tokens and web data. It replaces two standard alphabet characters and often omits trailing padding.
| Format | Characters 62 and 63 | Padding |
|---|---|---|
| Standard Base64 | + and / | = is commonly present |
| Base64url | - and _ | Often omitted |
Selecting the wrong alphabet can cause an error or produce the wrong bytes. A value containing - or _ is a strong sign that Base64url is required.
Why Base64 decoding fails
- Invalid characters: punctuation outside the selected alphabet may have been copied with the value.
- Bad padding: an equals sign appears in the wrong position or the final group has an impossible length.
- Wrong alphabet: standard Base64 and Base64url use different characters for two values.
- Invalid UTF-8: the Base64 may be valid, but its decoded bytes represent a binary file or text in another encoding.
- Nested encoding: the first result may itself be another Base64 string and require a deliberate second decode.
Do not keep adding padding until a value passes. Strict validation is useful because a decoder that silently changes malformed input can hide corruption.
Decode Base64 safely
Base64 is an encoding, not a security boundary. Treat unfamiliar output as untrusted data. Do not execute decoded scripts, open unexpected binary files, or expose secrets simply because the source looked like harmless text.
The ToolPixels decoder processes input in your browser and does not upload it to ToolPixels. It is designed for readable UTF-8 text, not for extracting images, archives, or documents.
Decode Base64 with ToolPixels
Use the free Base64 Decoder to decode standard Base64 or Base64url into readable UTF-8 text. It validates the alphabet, padding, padding bits, and decoded bytes before showing the result.