Skip to main content
Ordinary Utils Fast, free tools that respect your time.

QR Codes: How They Work and Best Practices

Understanding the technology behind those square barcodes.

Technology 9 min read Last updated: June 19, 2026

What is a QR Code?

A QR (Quick Response) code is a two-dimensional barcode that can store information in both horizontal and vertical directions. Originally invented in 1994 by Denso Wave (a Toyota subsidiary) for tracking automotive parts, QR codes have become ubiquitous in consumer applications.

Unlike traditional barcodes that store data in one dimension (horizontal lines), QR codes can hold significantly more information—up to several hundred times more than a standard barcode.

Anatomy of a QR Code

Every QR code contains several key components:

Finder Patterns (Position Detection)

The three large squares in corners that help scanners locate and orient the code. They're always the same size regardless of QR code dimensions.

Alignment Patterns

Smaller squares that help scanners read codes that are distorted or at an angle. Larger QR codes have more alignment patterns.

Timing Patterns

Alternating black and white modules connecting finder patterns. They help determine the size of individual modules.

Format Information

Encodes the error correction level and mask pattern used. Stored near the finder patterns.

Data and Error Correction

The actual encoded information plus redundancy for error recovery. Fills the remaining space.

Quiet Zone

The empty margin around the QR code (minimum 4 modules wide). Essential for accurate scanning.

Data Capacity

QR codes can store different types of data with varying capacities:

Data Type Max Capacity Character Set
Numeric 7,089 characters 0-9
Alphanumeric 4,296 characters 0-9, A-Z, space, $%*+-./:
Binary (Byte) 2,953 bytes ISO 8859-1
Kanji 1,817 characters Shift JIS

Maximum capacity assumes Version 40 (177Ă—177 modules) with the lowest error correction level.

Error Correction Levels

QR codes use Reed-Solomon error correction, allowing them to be read even if partially damaged or obscured:

Level L (Low) - 7% recovery

Maximum data capacity. Use when the code will be well-protected.

Level M (Medium) - 15% recovery

Good balance between capacity and reliability. Common default choice.

Level Q (Quartile) - 25% recovery

Higher reliability for codes that may get dirty or damaged.

Level H (High) - 30% recovery

Maximum error recovery. Required if adding logos or designs over the code. Reduces capacity significantly.

Higher error correction means larger QR codes for the same data. Choose based on your use case—a QR code on a business card needs less protection than one on outdoor signage.

Common QR Code Data Formats

URLs

https://example.com/page

WiFi Network

WIFI:T:WPA;S:NetworkName;P:Password;;

Phone Number

tel:+1234567890

SMS

SMSTO:+1234567890:Message text here

Email

mailto:email@example.com?subject=Subject&body=Message

vCard (Contact)

BEGIN:VCARD
VERSION:3.0
FN:John Doe
TEL:+1234567890
EMAIL:john@example.com
END:VCARD

Calendar Event

BEGIN:VEVENT
SUMMARY:Meeting
DTSTART:20240115T090000
DTEND:20240115T100000
END:VEVENT

QR Code Versions

QR codes come in 40 versions, each with increasing size and capacity:

  • Version 1: 21Ă—21 modules (~17 alphanumeric characters)
  • Version 10: 57Ă—57 modules (~174 alphanumeric characters)
  • Version 25: 117Ă—117 modules (~1,249 alphanumeric characters)
  • Version 40: 177Ă—177 modules (~4,296 alphanumeric characters)

Scanners automatically detect the version from the finder patterns. Smaller versions are faster to scan and work better at a distance.

Design Best Practices

Size and Scanning Distance

A good rule of thumb: the QR code should be at least 1/10th of the scanning distance. For example:

  • Business card (6 inches away): At least 0.6 inches (~15mm)
  • Poster (3 feet away): At least 3.6 inches (~90mm)
  • Billboard (30 feet away): At least 36 inches (~900mm)

Color Contrast

Dark on Light: The data modules must be darker than the background. Inverted (light on dark) codes may not scan reliably.

  • Black on white provides the best contrast
  • Maintain at least 40% contrast ratio
  • Avoid colors with similar luminance values
  • Test colored codes thoroughly before deployment

Quiet Zone

Always include a white margin (quiet zone) of at least 4 modules around the code. Without it, scanners may fail to detect the code boundaries.

Adding Logos

To add a logo over your QR code:

  • Use Level H error correction (30% recovery)
  • Keep the logo under 30% of the code area
  • Place the logo in the center (avoid finder patterns)
  • Test extensively—some scanners struggle with logos

QR Code Security

QR codes themselves don't provide security—anyone can read them. Consider these risks:

  • Malicious URLs: QR codes can link to phishing sites or malware downloads.
  • Code replacement: Attackers can place stickers over legitimate QR codes.
  • Tracking: Dynamic QR codes can track when and where they're scanned.

Safe Scanning Practices

  • Use scanners that preview URLs before opening
  • Be cautious of QR codes in public places
  • Check that the URL matches the expected domain
  • Avoid scanning codes that look tampered with

Static vs Dynamic QR Codes

Static QR Codes
  • Data encoded directly in code
  • Can't be changed after creation
  • Work offline
  • Free to create
Dynamic QR Codes
  • Contain redirect URL
  • Destination can be changed
  • Track scan analytics
  • Usually require subscription

Key Takeaways

  • QR codes are 2D barcodes that can store thousands of characters
  • Error correction allows reading damaged codes (L/M/Q/H levels)
  • Ensure adequate size, contrast, and quiet zone for reliable scanning
  • Use Level H error correction when adding logos
  • Dark modules on light background works best
  • Be security-conscious when scanning unknown codes

Create QR Codes

Use our QR code generator to create codes for URLs, text, WiFi, and contact information.

Open QR Generator →