A Python-based Base64 Text Encoder & Decoder Command Line Tool that lets you encode plain text into Base64 and decode Base64 back into readable text, right from your terminal. This CLI tool is built for learning encoding concepts, CTF practice, and quick text conversions, combining a simple no-dependency mode with a rich, colorful interactive CLI.
base64-text-encoder-decoder-python/
│
├── assets/ # Screenshots
├── main.py # Basic CLI application
├── parser.py # Argument-based CLI Version
├── interactive.py # Rich CLI Version
├── requirements.txt # Project Dependencies
├── LICENSE # Project license
└── README.md # Project documentation- Encodes any UTF-8 text into Base64
- Simple, single-function conversion (
base64.b64encode) - Instant terminal output of the encoded string
- Decodes Base64 text back into the original message
- Uses strict validation in the Rich CLI to catch malformed input
- Friendly error message on invalid Base64
- Colored terminal output with a custom banner
- Structured About table showing tool properties
- Styled panels for encode/decode results
- Better user experience and readability
- 🧼 Basic CLI → Lightweight, menu-driven, no dependencies (
main.py) - ⌨️ Argparse CLI → Flag-based, script-friendly (
parser.py) - 🎨 Rich CLI → Enhanced UI with colors, panels and menus (
interactive.py)
| Technology | Purpose |
|---|---|
| Python 3 | Core language |
| base64 | Encoding & decoding logic |
| argparse | Flag-based CLI argument parsing |
| Rich | Interactive CLI interface |
git clone https://github.com/ShakalBhau0001/base64-text-encoder-decoder-python.gitcd base64-text-encoder-decoder-pythonpip install richOR
pip install -r requirements.txtℹ️ The Basic CLI (
main.py) and Argparse CLI (parser.py) need no external dependencies — Rich is only required forinteractive.py.
python main.pypython parser.py -e <"Text_Message">
python parser.py -d <"Encoded_Text_Message">
python parser.py --enc <"Text_Message">
python parser.py --dec <"Encoded_Text_Message">
python parser.py --encode <"Text_Message">
python parser.py --decode <"Encoded_Text_Message">python interactive.py==========================================
BASE64 - ENCODER | DECODER
==========================================
[1] Encode
[2] Decode
[3] Exit
Enter your choice: 1
Enter text: Hello World
Encoded Base64:
SGVsbG8gV29ybGQ=Enter your choice: 2
Enter Base64 text: SGVsbG8gV29ybGQ=
Decoded text:
Hello Worldpython parser.py -e flowerpython parser.py --enc "Shakal Bhau"python parser.py --encode "Star The Repo"python parser.py -d "Zmxvd2Vy"python parser.py --dec "U2hha2FsIEJoYXU="python parser.py --decode "U3RhciBUaGUgUmVwbw=="[1] 🔒 Encode Text
[2] 🔓 Decode Text
[3] ℹ About
[0] 🚪 Exit
Select Option: 1
Enter text: CTF Practice- Text Type: UTF-8 encoded strings
- Encoding: Standard Base64 (
base64.b64encode/base64.b64decode) - Decode Validation: Strict, in Rich CLI (
validate=True)
⚠️ Invalid or malformed Base64 input will raise a clear error instead of a crash.
1️⃣ Encoding
- User text → encoded as UTF-8 bytes
- Bytes → converted to Base64 using
base64.b64encode - Result decoded back to a printable string
2️⃣ Decoding
- Base64 string → validated and decoded using
base64.b64decode - Decoded bytes → converted back to a UTF-8 string
- Invalid Base64 raises a handled error instead of crashing the tool
- Invalid Base64 input → Decode fails with a friendly error message
- Non-UTF-8 decoded bytes → Text can't be displayed as a string
- Empty input → Encoding/decoding an empty string returns an empty result
- File-based encode/decode (
--in-file/--out-file) - Support for URL-safe Base64 (
urlsafe_b64encode/urlsafe_b64decode) - Batch encode/decode for multiple lines at once
- Copy result directly to clipboard
- Argument-based (non-interactive) CLI mode for automation
This repository focuses on a specific encoding technique implemented as a command-line (CLI) learning project.
The goal of this project is to:
- Understand how Base64 encoding works at a practical level
- Practice decoding challenges commonly seen in CTFs
- Learn how simple CLI-based tools are structured
For more advanced, security-focused CLI tools, check out:
This project is intended for educational and learning purposes only.
Base64 is an encoding scheme, not encryption — it does not provide any confidentiality or security, and should never be used to protect sensitive data.
Creator: Shakal Bhau
GitHub: ShakalBhau0001
If you like this project, consider giving it a ⭐ on GitHub!



