Quick answer

Valid Base64 uses only A–Z, a–z, 0–9, +, / and optional padding with =.

Base64 Invalid Input

Valid Base64 uses only A–Z, a–z, 0–9, +, / and optional padding with =. Invalid characters, wrong length, or bad padding cause decode errors.

Common causes

How to fix

Examples

Bad

SGVsbG8gV29ybGQ=

Good

SGVsbG8gV29ybGQ=

FAQ

What is valid Base64?
Only A–Z, a–z, 0–9, +, / and = for padding. No spaces or other characters in the encoded string.
Why does decode fail with 'invalid character'?
The string contains a character not in the Base64 alphabet. Remove or replace it (e.g. strip whitespace).

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical