QR (Quick Response) codes are two-dimensional barcodes that can store URLs, text, contact information, WiFi credentials, and more. Invented by Denso Wave in 1994 for automotive parts tracking, they have become ubiquitous — from restaurant menus to payment systems to event tickets. This guide explains how QR codes work at a technical level and provides practical guidance for creating effective QR codes.
How QR Codes Work
A QR code is a square grid of black and white modules (pixels) that encode data using a specific pattern:
- Finder patterns: The three large squares in the corners help scanners detect and orient the code regardless of rotation.
- Alignment patterns: Smaller squares that help correct for perspective distortion (present in version 2+ codes).
- Timing patterns: Alternating black and white modules between finder patterns that define the grid coordinate system.
- Format information: Encodes the error correction level and mask pattern used.
- Version information: In larger codes (version 7+), encodes the QR version number.
- Data and error correction: The actual encoded data plus Reed-Solomon error correction codewords.
QR Code Versions and Data Capacity
QR codes come in 40 versions, from version 1 (21x21 modules) to version 40 (177x177 modules). Larger versions hold more data but are harder to scan at small sizes.
| Version | Modules | Numeric (max) | Alphanumeric (max) | Bytes (max) |
|---|---|---|---|---|
| 1 | 21x21 | 41 | 25 | 17 |
| 5 | 37x37 | 202 | 122 | 84 |
| 10 | 57x57 | 652 | 395 | 271 |
| 20 | 97x97 | 2,061 | 1,249 | 858 |
| 40 | 177x177 | 7,089 | 4,296 | 2,953 |
Capacities shown are for the lowest error correction level (L). Higher error correction reduces data capacity.
Error Correction Levels
QR codes use Reed-Solomon error correction, allowing them to be read even when partially damaged or obscured:
| Level | Recovery Capacity | Best For |
|---|---|---|
| L (Low) | ~7% damage recovery | Maximum data capacity, clean environments |
| M (Medium) | ~15% damage recovery | General purpose (default) |
| Q (Quartile) | ~25% damage recovery | Industrial, outdoor use |
| H (High) | ~30% damage recovery | QR codes with logos or heavy customization |
When adding a logo to the center of a QR code, always use error correction level H. The logo effectively "damages" 5-10% of the code, and H-level correction ensures reliable scanning.
Static vs Dynamic QR Codes
| Feature | Static QR Code | Dynamic QR Code |
|---|---|---|
| Data storage | Data encoded directly | Short redirect URL encoded |
| Editable after creation | No (data is fixed) | Yes (change destination URL) |
| Expiration | Never expires | Depends on redirect service |
| Scan tracking | Not possible | Analytics available |
| Code complexity | Grows with data length | Always small (short URL) |
| Privacy | No third-party involved | Redirect service sees all scans |
QR Code Data Types
QR codes can encode various data types that trigger automatic actions on smartphones:
- URL:
https://example.com— opens in browser - WiFi:
WIFI:T:WPA;S:NetworkName;P:password;;— auto-connects to WiFi - vCard: Contact information that adds directly to address book
- Email:
mailto:user@example.com?subject=Hello - Phone:
tel:+15551234567— initiates a phone call - SMS:
sms:+15551234567?body=Message - Geo location:
geo:40.7128,-74.0060— opens in maps - Plain text: Any arbitrary text string
Design Best Practices
Minimum Print Size
The minimum size depends on scanning distance:
- Close range (phone near code): Minimum 2x2 cm (0.8x0.8 inches)
- 1 meter distance: At least 10x10 cm
- 3 meters distance: At least 30x30 cm
- General rule: QR code size should be 1/10th of the scanning distance
Quiet Zone
Always maintain a white border (quiet zone) of at least 4 modules around the QR code. Without this border, scanners may fail to detect the code boundaries.
Color and Contrast
- Maintain high contrast between foreground and background (dark on light works best)
- Never invert colors (white on black) for print — many scanners struggle with inverted codes
- Avoid low-contrast color combinations (e.g., yellow on white, light blue on white)
- The foreground must always be darker than the background
Logo Placement
- Keep the logo under 10% of the total QR code area
- Center it to avoid overlapping finder patterns or timing patterns
- Always use error correction level H when adding a logo
- Test scanning reliability after adding the logo
Create QR codes with custom colors and error correction with the WizlyTools QR Code Generator, or decode existing codes with the QR Code Scanner.