How QR Codes Work: Structure and Technology Explained
QR Code (Quick Response Code) is a two-dimensional barcode invented by Japan's Denso Wave in 1994. From checkout counters to mobile payments, restaurant menus to vaccine certificates, QR Codes have become part of everyday life. But have you ever wondered how those black and white squares actually encode and decode information?
Basic QR Code Structure
A standard QR Code contains these key regions:
1. Finder Patterns
The large squares in three corners help scanners quickly locate the QR Code's position and orientation. Each finder pattern is a 7x7 module of nested black and white squares. Scanning works correctly from any angle.
2. Alignment Patterns
Larger QR Codes (version 2+) include additional alignment patterns to correct distortion from skewed printing or curved surfaces.
3. Timing Patterns
Alternating black and white lines connecting the finder patterns, letting the scanner determine module coordinates.
4. Format Information
Contains error correction level and mask pattern data, located near the finder patterns.
5. Data Area
The main body containing the actual encoded data and error correction codes.
Key takeaway: The brilliance of QR Codes is that even when partially obscured or damaged, they can still be read successfully through error correction. This is thanks to the powerful Reed-Solomon error correction codes.
QR Code Versions
QR Codes have 40 versions, from version 1 (21x21 modules) to version 40 (177x177 modules). Higher versions store more data:
| Version | Modules | Max Numeric | Max Alphanumeric |
|---|---|---|---|
| Version 1 | 21 x 21 | 41 | 25 |
| Version 5 | 37 x 37 | 154 | 93 |
| Version 10 | 57 x 57 | 652 | 395 |
| Version 20 | 97 x 97 | 1,852 | 1,123 |
| Version 40 | 177 x 177 | 7,089 | 4,296 |
Error Correction Levels
QR Codes use Reed-Solomon error correction codes, providing four levels of fault tolerance:
| Level | Code | Recovery Capacity | Best For |
|---|---|---|---|
| Low | L | ~7% | Clean environments, maximum capacity |
| Medium | M | ~15% | General use (default) |
| Quartile | Q | ~25% | Harsher environments |
| High | H | ~30% | Logo embedding, outdoor use |
Higher error correction levels consume more space, so the same QR Code version stores less data at higher correction levels.
Encoding Modes
QR Codes support multiple encoding modes, automatically selecting the most efficient:
- Numeric mode — encodes 3 digits in 10 bits
- Alphanumeric mode — encodes 2 characters in 11 bits (0-9, A-Z, space, and some symbols)
- Byte mode — uses 8 bits per byte (supports UTF-8 and various encodings)
- Kanji mode — uses 13 bits per character (Shift JIS encoding)
QR Code vs Traditional Barcodes
| Feature | Traditional Barcode (1D) | QR Code (2D) |
|---|---|---|
| Data capacity | ~20 characters | Up to 7,089 digits |
| Encoding direction | Horizontal only | Horizontal + vertical |
| Error correction | None | Up to 30% recovery |
| Scan angle | Must be horizontally aligned | 360-degree from any angle |
| Data types | Numbers/text only | Numbers, text, URLs, binary |
Conclusion
Behind the seemingly simple black and white squares lies sophisticated encoding theory and fault-tolerant design. From its 1994 origins in automotive parts tracking to today's ubiquitous digital bridge, the QR Code's success comes from its clever technical design and exceptional practicality.
References
- ISO/IEC. "ISO/IEC 18004:2015 — QR Code bar code symbology specification." International Organization for Standardization, 2015. https://www.iso.org/standard/62021.html
- Denso Wave. "History of QR Code." Denso Wave Incorporated, 2024. https://www.qrcode.com/en/history/
- Reed, I. S. & Solomon, G. "Polynomial Codes Over Certain Finite Fields." Journal of the Society for Industrial and Applied Mathematics, vol. 8, no. 2, 1960, pp. 300-304.
- Wikipedia contributors. "QR code." Wikipedia, The Free Encyclopedia, 2025. https://en.wikipedia.org/wiki/QR_code