base64 — Easy Examples
Encode/decode binary data as base64/base32/base16 text
Getting started with base64
Basic import and usage of the base64 module.
python
import base64 # Encode original = b"Hello, Python!" encoded = base64.b64encode(original) print(f"Encoded: {encoded}") # Decode decoded = base64.b64decode(encoded) print(f"Decoded: {decoded}")
The base64 module is part of Python's standard library. Encode/decode binary data as base64/base32/base16 text.
Common base64 operations
Frequently used functions from the base64 module.
python
# More base64 examples import base64 print(f"base64 module loaded successfully") print(f"Location: {base64.__name__}") print(f"Has {len(dir(base64))} attributes")
These are the most commonly used features of the base64 module.
Want to try these examples interactively?
Open Easy Playground