QR codes are everywhere â restaurant menus, product packaging, event tickets, business cards, and digital marketing campaigns. Yet most people generate QR codes without understanding the technical factors that determine whether a code will scan reliably. This complete QR code best practices guide covers everything you need to know about QR code sizing, format selection, error correction levels, data capacity, content types, and design considerations to ensure your codes work perfectly every time.
QR Code Basics: How They Work
QR (Quick Response) codes are two-dimensional matrix barcodes invented by Denso Wave in 1994. Unlike traditional one-dimensional barcodes that encode data in a single direction, QR codes store data in both horizontal and vertical patterns, enabling them to hold significantly more information.
A QR code is made up of modules â the individual black and white squares that form the pattern. The number of modules determines the QR code version. QR codes range from Version 1 (21x21 modules) to Version 40 (177x177 modules). Higher versions can store more data but require more modules and therefore need to be printed larger to remain scannable.
Every QR code contains these structural components:
- Finder patterns: The three large squares in the corners that help scanners detect and orient the code
- Alignment patterns: Smaller squares that help correct distortion, present in Version 2 and above
- Timing patterns: Alternating black and white modules that help the scanner determine module size
- Format information: Data about the error correction level and mask pattern used
- Data and error correction: The actual encoded data plus Reed-Solomon error correction codewords
- Quiet zone: The mandatory white border around the code (minimum 4 modules wide)
QR Code Version Reference:
âââââââââââŹââââââââââââââŹâââââââââââââââââââââââââââââââ
â Version â Modules â Typical Use â
âââââââââââŒââââââââââââââŒâââââââââââââââââââââââââââââââ€
â 1 â 21 x 21 â Short URLs, numeric codes â
â 2 â 25 x 25 â Short URLs with tracking â
â 3 â 29 x 29 â Standard URLs (50-70 chars) â
â 5 â 37 x 37 â Long URLs, vCard basic â
â 10 â 57 x 57 â Full vCard, WiFi config â
â 15 â 77 x 77 â Large text blocks â
â 20 â 97 x 97 â Very large data payloads â
â 40 â 177 x 177 â Maximum capacity (rarely used)â
âââââââââââŽââââââââââââââŽâââââââââââââââââââââââââââââââMinimum Size Guide: Print, Screen, and Billboard
The minimum size of a QR code depends on the scanning context. A code that works perfectly on a phone screen may be unreadable when printed on a business card, and vice versa. The key principle is: the scanning distance determines the minimum size.
The general rule of thumb is that a QR code should be at least 1/10th of the scanning distance. If someone will scan the code from 30 cm (12 inches) away, the code should be at least 3 cm (1.2 inches) wide. This is known as the 10:1 ratio.
Print (300 DPI): For printed materials like business cards, flyers, and brochures, the minimum recommended size is 2 cm x 2 cm (0.8 x 0.8 inches). At 300 DPI, this gives each module enough pixels to be clearly distinguishable. For business cards specifically, 2.5 cm x 2.5 cm (1 x 1 inch) is safer since the scanning distance is typically close range (10-20 cm).
Screen display: For digital displays (mobile screens, tablets, monitors), the minimum recommended size is 240 x 240 pixels for standard viewing. On high-DPI (Retina) screens, aim for 320 x 320 CSS pixels to ensure crisp rendering. The code must be displayed at a 1:1 pixel ratio or larger â never scale a QR code down below its native module resolution.
Billboards and signage: For large-format printing meant to be scanned from a distance, use the 10:1 ratio strictly. A billboard scanned from 10 meters away needs a QR code at least 1 meter x 1 meter. For highway billboards (20+ meters), the code needs to be at least 2 meters x 2 meters, though QR codes on highway billboards are generally a bad idea since drivers should not be scanning while driving.
Scanning Distance vs. Minimum QR Code Size
Use this reference table to determine the minimum QR code size based on expected scanning distance:
| Scanning Distance | Minimum QR Code Size | Typical Application |
|---|---|---|
| 10 cm (4 in) | 1 cm x 1 cm | Product labels, jewelry tags |
| 20 cm (8 in) | 2 cm x 2 cm | Business cards, receipts |
| 30 cm (12 in) | 3 cm x 3 cm | Flyers, brochures, menus |
| 50 cm (20 in) | 5 cm x 5 cm | Product packaging, book covers |
| 1 m (3.3 ft) | 10 cm x 10 cm | Posters, table tents |
| 2 m (6.6 ft) | 20 cm x 20 cm | Indoor signage, window displays |
| 5 m (16 ft) | 50 cm x 50 cm | Trade show banners, event signage |
| 10 m (33 ft) | 1 m x 1 m | Outdoor billboards, building signage |
| 20 m (66 ft) | 2 m x 2 m | Large outdoor advertising |
Error Correction Levels: L, M, Q, H
QR codes use Reed-Solomon error correction to allow scanning even when part of the code is damaged, dirty, or obscured. There are four error correction levels, each trading data capacity for resilience:
| Level | Recovery Capacity | Data Overhead | Best For |
|---|---|---|---|
| L (Low) | ~7% of codewords | Lowest | Clean digital screens, maximum data capacity needed |
| M (Medium) | ~15% of codewords | Moderate | General purpose (default), printed materials |
| Q (Quartile) | ~25% of codewords | High | Industrial/warehouse labels, outdoor use |
| H (High) | ~30% of codewords | Highest | Logo embedding, harsh environments, partial obstruction |
Recommendation: Use Level M (15%) as the default for most applications. It provides a good balance between data capacity and damage tolerance. Use Level H (30%) if you plan to embed a logo in the center of the QR code, since the logo effectively "damages" the code. Use Level L (7%) only when you need maximum data capacity and the code will be displayed in a controlled, clean environment (like a digital screen).
Error correction works by adding redundant data (parity codewords) to the encoded message. When a scanner reads the code, it uses these parity codewords to detect and correct errors. The higher the error correction level, the more parity codewords are added, which means fewer codewords are available for actual data â hence the trade-off between capacity and resilience.
Data Capacity by Error Correction Level
The maximum number of characters a QR code can store depends on the data type and error correction level. Here is the capacity for a Version 40 (maximum size) QR code:
| Data Type | Level L (7%) | Level M (15%) | Level Q (25%) | Level H (30%) |
|---|---|---|---|---|
| Numeric (0-9) | 7,089 | 5,596 | 3,993 | 3,057 |
| Alphanumeric (A-Z, 0-9, symbols) | 4,296 | 3,391 | 2,420 | 1,852 |
| Binary / Byte (UTF-8) | 2,953 | 2,331 | 1,663 | 1,273 |
| Kanji / Kana | 1,817 | 1,435 | 1,024 | 784 |
Important: These are theoretical maximums for Version 40 codes (177x177 modules). In practice, you should keep data as short as possible. A URL-shortened link (around 30 characters) fits comfortably in a Version 3 code (29x29 modules), which is much smaller and easier to scan. Every additional character increases the version number and the number of modules, making the code harder to scan at small sizes.
Best Format: SVG vs PNG vs PDF
Choosing the right file format for your QR code is critical for quality and flexibility:
| Feature | SVG | PNG | |
|---|---|---|---|
| Type | Vector | Raster | Vector (container) |
| Scalability | Infinite, no quality loss | Fixed resolution, pixelates when scaled up | Infinite (if vector content inside) |
| File size | Very small (2-10 KB) | Small to medium (5-50 KB) | Small (5-20 KB) |
| Web use | Excellent (inline or img tag) | Good (standard img tag) | Poor (requires embed/iframe) |
| Print use | Excellent (any DPI) | Good (if generated at 300+ DPI) | Excellent (industry standard for print) |
| Editability | Easy (XML text, CSS styling) | Difficult (requires image editor) | Moderate (requires PDF editor) |
| Color customization | Easy (CSS fill/stroke) | Must be set at generation time | Depends on content type |
| Best for | Web, master file, any size output | Social media, email, messaging | Professional print, prepress |
Recommendation: Always generate QR codes as SVG first. SVG is the master format from which you can derive any other format at any size. Use SVG directly for web display and convert to high-resolution PNG (minimum 1000x1000 pixels) or PDF for print. Never generate a QR code as a small raster image and then scale it up â this creates blurry modules that scanners struggle to read.
QR Code Content Types
QR codes can encode different types of structured data. Here are the most common content types and their URI/format schemes:
| Content Type | Format / URI Scheme | Example |
|---|---|---|
| URL | https:// | https://example.com/page |
| vCard (Contact) | BEGIN:VCARD...END:VCARD | BEGIN:VCARD\nVERSION:3.0\nN:Doe;John\nTEL:+1234567890\nEND:VCARD |
| WiFi | WIFI:S:...;T:...;P:...;; | WIFI:S:MyNetwork;T:WPA;P:password123;; |
mailto: | mailto:hello@example.com?subject=Hello | |
| SMS | sms: or smsto: | sms:+1234567890?body=Hello |
| Phone Call | tel: | tel:+1234567890 |
| Geo Location | geo: | geo:40.7128,-74.0060?q=New+York |
| Calendar Event | BEGIN:VEVENT...END:VEVENT | BEGIN:VEVENT\nSUMMARY:Meeting\nDTSTART:20260301T100000Z\nEND:VEVENT |
| Plain Text | Raw text string | Any plain text message up to capacity limit |
When encoding URLs, always include the full protocol (https://). Without it, many scanners will treat the content as plain text rather than a clickable link. For maximum compatibility, keep URLs under 100 characters by using URL shorteners or clean URL paths.
// Common QR code content format examples
// URL (most common)
"https://example.com/product/12345"
// WiFi network configuration
"WIFI:S:NetworkName;T:WPA;P:MyPassword123;H:false;;"
// S = SSID, T = Security type (WPA/WEP/nopass), P = Password, H = Hidden
// vCard contact
"BEGIN:VCARD\nVERSION:3.0\nFN:John Doe\nORG:Acme Corp\nTEL:+1-555-0123\nEMAIL:john@example.com\nURL:https://example.com\nEND:VCARD"
// Email with subject and body
"mailto:support@example.com?subject=Help%20Request&body=I%20need%20assistance"
// SMS message
"sms:+15550123?body=Hello%20from%20QR"
// Geo location (latitude,longitude)
"geo:37.7749,-122.4194?q=San+Francisco"
// Calendar event (iCalendar format)
"BEGIN:VEVENT\nSUMMARY:Team Meeting\nDTSTART:20260315T140000Z\nDTEND:20260315T150000Z\nLOCATION:Conference Room A\nEND:VEVENT"Design Tips: Quiet Zone, Colors, and Logo Embedding
While QR codes are functional elements, they can be designed to match your brand identity â within limits. Here are the key design rules:
Quiet zone: The quiet zone is the mandatory white border around the QR code. It must be at least 4 modules wide on all sides. This border is how scanners differentiate the code from surrounding content. Cropping or reducing the quiet zone is the single most common cause of scanning failures. Never place text, graphics, or other design elements within the quiet zone.
Colors: QR codes work best with high contrast. The standard is black modules on a white background. You can customize colors, but follow these rules: (1) Dark modules on a light background â never invert this. (2) Maintain a contrast ratio of at least 4:1 between foreground and background. (3) Avoid gradients on modules. (4) Do not use similar colors for foreground and background (e.g., dark blue on black). (5) Test on multiple devices before deploying colored QR codes.
Logo embedding: You can place a small logo in the center of a QR code if you use error correction Level H (30%). The logo should cover no more than 10-15% of the total code area to stay within the error correction budget. Place the logo precisely in the center, use a white or light padding around it, and always test the code with the logo on at least 5 different devices and apps before deploying. Note that the logo area effectively "destroys" the modules underneath it, so the scanner relies entirely on error correction to recover that data.
Module shapes: Some QR code generators offer rounded or dot-shaped modules instead of squares. While these can look more appealing, they reduce scanner reliability. If you use non-square modules, test extensively. The finder patterns (corner squares) should always remain standard squares for maximum compatibility.
/* QR Code Design Checklist */
â Quiet zone: 4+ modules on all sides (never crop)
â Contrast ratio: 4:1 minimum (dark on light)
â Module color: Dark foreground, light background
â Logo size: Max 10-15% of code area (use EC Level H)
â Logo padding: White border around logo
â Finder patterns: Keep standard square shape
â Resolution: SVG or 300+ DPI PNG for print
â Testing: 3+ devices, multiple lighting conditions
â Do NOT invert colors (white on dark)
â Do NOT use gradients on modules
â Do NOT crop the quiet zone
â Do NOT use similar foreground/background colors
â Do NOT scale up low-resolution raster imagesTesting: Multiple Devices and Conditions
A QR code that scans on your phone may fail on other devices, in different lighting, or at different distances. Thorough testing is essential:
- Test on at least 3 devices: iOS (Camera app), Android (Google Lens or Camera), and a dedicated QR scanner app. Each uses different decoding algorithms with different tolerances.
- Test at different distances: Scan from the minimum expected distance, the maximum expected distance, and somewhere in between.
- Test in different lighting: Bright sunlight (causes glare), indoor fluorescent lighting, dim/dark environments, and with camera flash.
- Test on the actual medium: Print the code on the actual material (glossy paper, matte paper, packaging, fabric) and test. Glossy surfaces can cause reflections that interfere with scanning.
- Test with the actual content: If the QR code links to a URL, verify the URL works, loads correctly on mobile, and does not redirect through too many intermediaries.
- Test at the actual size: If the code will be printed at 2 cm, test a printout at exactly 2 cm. Do not test a large version and assume the small version will work.
- Test after production: Check printed materials after the print run. Print quality issues (low ink, misalignment, paper texture) can degrade QR code readability.
# QR Code Testing Protocol
## Device Testing Matrix
ââââââââââââââââŹââââââââââââââââââŹâââââââââââââââââ
â Platform â Scanner App â Status â
ââââââââââââââââŒââââââââââââââââââŒâââââââââââââââââ€
â iPhone â Camera (native) â â Pass / â Failâ
â iPhone â Chrome â â Pass / â Failâ
â Android â Camera (native) â â Pass / â Failâ
â Android â Google Lens â â Pass / â Failâ
â Any device â Dedicated app â â Pass / â Failâ
ââââââââââââââââŽââââââââââââââââââŽâââââââââââââââââ
## Distance Testing
- Minimum distance (10 cm): â Pass / â Fail
- Normal distance (30 cm): â Pass / â Fail
- Maximum distance (per spec): â Pass / â Fail
## Lighting Testing
- Bright sunlight: â Pass / â Fail
- Indoor fluorescent: â Pass / â Fail
- Dim / low light: â Pass / â Fail
- With camera flash: â Pass / â Fail
## Medium Testing
- Screen display: â Pass / â Fail
- Printed (actual material): â Pass / â Fail
- Printed (actual size): â Pass / â FailCommon Mistakes to Avoid
These are the most frequent QR code mistakes that lead to scanning failures:
- Too small: Printing QR codes smaller than 2 cm for handheld scanning. Small codes with dense data are extremely hard to scan, especially on older devices. Always err on the side of larger.
- Low contrast: Using colors that do not provide enough contrast between modules and background. Light gray on white, dark blue on black, or any combination below a 4:1 contrast ratio will cause failures.
- No quiet zone: Cropping the white border or placing the code directly against other graphics. The quiet zone is not optional â without it, scanners cannot determine where the code begins and ends.
- Too much data: Encoding an entire paragraph of text or a 200-character URL. Keep data minimal. Use URL shorteners for links. The more data you encode, the denser the code and the harder it is to scan.
- Low resolution raster: Generating a QR code as a 100x100 pixel PNG and then scaling it up for print. This creates blurry, unreadable modules. Always generate at the target resolution or use SVG.
- Inverting colors: Creating a QR code with white modules on a dark background. Most scanners expect dark-on-light. Some modern scanners handle inversion, but many do not.
- Dynamic URL that expires: Linking to a URL that will change or expire. QR codes on printed materials are permanent â if the URL goes dead, the code becomes useless. Use permanent, redirect-capable URLs.
- Not testing on print: Testing only on a screen. Screen resolution, brightness, and contrast are very different from print. Always test on the actual printed medium.
- Placing on curved surfaces: Wrapping a QR code around a cylinder (like a bottle) without accounting for distortion. If the code wraps more than 30 degrees, it becomes difficult to scan.
- Ignoring error correction: Using Level L for a code that will be printed on a textured surface or partially covered by packaging. Always match the error correction level to the expected environment.
Frequently Asked Questions
What is the minimum size for a scannable QR code?
The minimum size depends on the scanning distance. For handheld scanning (10-30 cm away), the code should be at least 2 cm x 2 cm (0.8 x 0.8 inches). The general rule is the 10:1 ratio: the code should be at least 1/10th of the scanning distance. For digital screens, use at least 240x240 pixels. Always test at the actual size on the actual medium with multiple devices.
Which error correction level should I use?
Use Level M (15%) as the default for most use cases. Use Level H (30%) if you are embedding a logo in the center of the code, as the logo covers and effectively destroys some modules. Use Level L (7%) only for clean, controlled environments like digital screens where damage is unlikely and you need maximum data capacity.
Should I use SVG or PNG for my QR code?
Always generate QR codes as SVG first. SVG is a vector format that scales to any size without losing quality. Use SVG directly for web display. For print, export the SVG to a high-resolution PNG (at least 1000x1000 pixels at 300 DPI) or embed the SVG in a PDF. Never generate a small raster image and scale it up â this causes blurry modules that fail to scan.
Can I put a logo in my QR code?
Yes, but only if you use error correction Level H (30%). The logo should cover no more than 10-15% of the total code area and must be placed precisely in the center. Add white padding around the logo so it does not blend into surrounding modules. Always test the code with the logo on at least 5 different devices before deploying, as logo placement can cause scanning failures on some readers.
How much data can a QR code hold?
A maximum-size QR code (Version 40, 177x177 modules) can hold up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data at the lowest error correction level. However, in practice, you should keep data as short as possible. A typical URL (50-80 characters) fits in a Version 3-5 code that is easy to scan at small sizes. More data means more modules, which means the code needs to be larger to remain scannable.