QR Codes Cheat Sheet
QR code structure, versions, error correction levels, encoding modes, and generation/scanning guidance.
Reference
qr-code
barcode
encoding
A QR code encodes data in a two-dimensional matrix that scanners decode with error correction. Choosing the right version, error-correction level, and encoding mode affects size, capacity, and reliability.
Structure
Table
| Element | Purpose |
|---|---|
| Finder patterns | Three corner squares for orientation. |
| Timing patterns | Rows/columns for module alignment. |
| Alignment patterns | Aid decoding on larger codes. |
| Format info | Error-correction level + mask. |
| Data + ECC | The payload and redundancy. |
Error correction levels
Table
| Level | Recovery | Use case |
|---|---|---|
| L | ~7% | Clean, controlled environments. |
| M | ~15% | General purpose (default). |
| Q | ~25% | Industrial, printed labels. |
| H | ~30% | Logos, damage-prone surfaces. |
Versions and capacity
Table
| Version | Modules | Max numeric capacity (L) |
|---|---|---|
| 1 | 21×21 | 41 digits |
| 10 | 57×57 | 652 digits |
| 40 | 177×177 | 7089 digits |
Higher versions store more but require more resolution to scan reliably.
Encoding modes
Table
| Mode | Efficiency |
|---|---|
| Numeric | Best (0-9). |
| Alphanumeric | Good (0-9, A-Z, some symbols). |
| Byte | Binary/UTF-8 text. |
| Kanji | Japanese characters. |
Generation tips
Table
| Tip | Why |
|---|---|
| Use quiet zone | Keep a 4-module white margin. |
| Keep URLs short | Smaller code, faster scan. |
| Test at target size | Small codes need higher contrast. |
| Avoid low contrast | Dark on light, not light on dark. |