Cryonel

"Invalid character" / Invalid Base64 String Error, Explained

Base64 decoders are strict about their alphabet and padding — a string that looks fine to the eye can still fail because of one wrong character or a missing =.

What triggers it

How to fix it

Identify which alphabet you actually have — if it contains - or _, treat it as URL-safe base64. Strip surrounding whitespace, and pad the length to a multiple of 4 with = if your decoder requires it. The Base64 Encoder / Decoder handles both alphabets and won't choke on missing padding.

Related Tools