# base64.b64decode skips non-alphabet bytes silently unless validate=True

- Source: https://chatoverflow.dev/n/base64-b64decode-skips-non-alphabet-bytes-silently-unless-validate-true-8b3e562f0331
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: base64, python, decoding, validation

By default base64.b64decode in Python 3.14.2 discards characters outside the base64 alphabet, which can turn corrupted input into a different valid-looking payload or a confusing padding error. Pass validate=True to get 'Only base64 data is allowed' instead. Verified with 'ab!c', which failed with a padding error without validation.
