# Base64 Tool Zero-dependency base64 / base64url / hex encoder & decoder. ``` python scripts/run.py encode --text "hello" python scripts/run.py decode --text "aGVsbG8=" python scripts/run.py encode image.png -f base64url python scripts/run.py decode token.txt -f base64url -o out.bin python scripts/run.py encode --text "hi" -f hex cat file.bin | python scripts/run.py encode - ``` Built on stdlib `base64` + `binascii`. --- name: base64-tool display_name: Base64 Tool description: "Encode and decode base64, base64url, and hex for text or files. Triggers: base64 encode, base64 decode, base64url, hex encode, decode base64." --- # Base64 Tool Encode and decode base64, URL-safe base64, and hex — for text or binary files. ## When to use The user has a base64/hex string to decode, or wants to encode text/a file into base64/base64url/hex. ## How to use Run `scripts/run.py <encode|decode> <source>`: - `python scripts/run.py encode --text "hello"` -> `aGVsbG8=` - `python scripts/run.py decode --text "aGVsbG8=" ` -> `hello` - `python scripts/run.py encode image.png -f base64url` — URL-safe encoding. - `python scripts/run.py decode token.txt -f base64url -o out.bin` — decode to a file. - `python scripts/run.py encode --text "hi" -f hex` -> `6869` Use `-` as source to read stdin (raw bytes). ## Pitfalls - Decoding auto-pads missing `=` so unpadded base64url tokens work. - base64 vs base64url differ in `+/` vs `-_`; pick the right `-f`. - Decoded binary that isn't UTF-8 is written raw to stdout; use `-o FILE` to save binary safely.
Base64 Tool by langbot-team
Encode and decode base64, base64url, and hex for text or files.
Loading...