Decodex
← Back to the Base64 tool

BASE64 GUIDE

How to fix Base64 decoding errors

Troubleshoot invalid Base64 characters, padding, copied URLs and UTF-8 errors with examples tested in Decodex.

When a Base64 value fails to decode, first separate a format problem from a text interpretation problem. Decodex is a UTF-8 text tool: valid Base64 can still represent an image or bytes that cannot be read as UTF-8.

1. Check characters and padding

If quotes or commas surround a copied value, check whether they belong to a wrapper and copy only the Base64 field. If an equals sign appears in the middle, or part of the value is missing, retrieve the original. The Base64 specification places padding at the end.

Examples you can test in Decodex
InputResult or next step
SGVsbG8=Decodes to Hello.
SGVsbG8Decodex handles omitted trailing padding.
Zg=Incomplete padding. If the original text was f, the correct value is Zg==.
AThis length cannot represent complete data. Check for missing content.

Decodex ignores whitespace and accepts the Base64URL characters - and _. Other tools or APIs may use stricter rules. Adding padding cannot restore missing content.

2. Check values copied from URLs, JSON, or data URLs

For a JSON value such as "SGVsbG8=", paste the content without the quotes. For data:text/plain;base64,SGVsbG8=, paste only SGVsbG8= after the comma. An image data URL still contains binary image data, which this text tool cannot display.

A value containing percent escapes such as %3D may need URL decoding before Base64 decoding. Some transport layers also turn + into a space. Compare with the original: replacing every space with a plus can corrupt genuine formatting whitespace.

A whole token separated by dots is not a single Base64 value. Identify the field you actually need to decode first.

3. “Binary data or invalid UTF-8”

This error means the decoded bytes could not be interpreted as UTF-8 text. For example, /w== is valid Base64, but its decoded byte is not valid UTF-8 text.

See our Korean and emoji conversion guide for the text encoding workflow.

4. Start with a working example

  1. Paste SGVsbG8= into the decoder and check that the result is Hello.
  2. If that works, compare your own value’s source format and character encoding.
  3. If an error appears while typing an incomplete value, paste the whole value or turn off Auto convert and use the manual button.
  4. For a size-limit error, try a smaller sample. This tool’s conversion limit is 5 MiB (5 × 1024 × 1024 bytes).

If the problem continues, report the browser and error message with a short, non-confidential sample. Avoid passwords or tokens.