A QR code encoder and decoder built from scratch in Java without external libraries.
- Encode text strings into QR codes
- Decode QR codes back to text
- Multiple encoding modes:
- Numeric (0-9)
- Alphanumeric (A-Z, 0-9, and special characters)
- Byte (UTF-8 text)
- Kanji (planned)
- Configurable error correction levels:
L- Low (~7% recovery)M- Medium (~15% recovery)Q- Quartile (~25% recovery)H- High (~30% recovery)
- Java 17 or higher
- Maven 3.x
mvn clean installmvn exec:javaThe interactive CLI will prompt you to:
- Choose between encoding or decoding
- Enter the input string
- Select an error correction level (for encoding)
src/main/java/com/
├── qr/
│ ├── QR.java # Main entry point
│ └── utils/
│ └── QRUtils.java # Encoding/decoding utilities
└── constants/
├── Constants.java # Alphanumeric character set
├── ErrorCorrection.java # Error correction levels enum
└── Modes.java # Encoding modes enum
QR Code Encoder/Decoder
Enter 'encode' to encode a string or 'decode' to decode a QR code:
encode
Enter the string to encode:
HELLO WORLD
Choose the error correction level (L, M, Q, H):
M
Encoded QR Code: Encoded(HELLO WORLD)
MIT