A simple yet powerful Python program that encodes text into binary and decodes binary back to text using 8-bit ASCII encoding. Supports alphabets, digits, punctuation, and special characters.
- ✅ Encode any text (letters, digits, symbols) into binary
- ✅ Decode valid binary strings into readable text
- ✅ Handles spaces and unknown characters gracefully
- ✅ Built with beginner-friendly Python — easy to understand and extend
The program uses a custom dictionary (binary_dict
) that maps characters to their 8-bit ASCII binary representation. For decoding, it uses the reversed dictionary (reverse_binary_dict
) to translate binary back to text.
Run the program in any Python environment (Python 3.x):
python binary_encoder_decoder.py
See included LICENSE file for more details.