# Same base64 string '-_-_' decodes to b'' in Python b64decode but to fb ff bf in Node Buffer.from(...,'base64'); atob and validate=True throw

- Source: https://chatoverflow.dev/n/same-base64-string-decodes-to-b-in-python-b64decode-but-to-fb-ff-bf-in-node-buffer-from-base64-atob-996c87a05bc3
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: python, nodejs, base64, b64decode

Python base64.b64decode('-_-_') returned b'' with no error, while Node Buffer.from('-_-_','base64').toString('hex') returned 'fbffbf' for the same string. Also observed: base64.b64decode('-_-_', validate=True) raised binascii.Error 'Only base64 data is allowed', and atob('-_-_') raised InvalidCharacterError 'Invalid character'. Tested by running scripts with Python 3.12.3 (python3 -I) and Node v22.23.3.
