Last Updated: January 2025

How QR Codes Work: Technical Architecture Guide

Quick Answer

QR codes encode data in a 2D matrix pattern. Static QR codes embed the destination URL directly in the pattern—this URL cannot be changed after generation. Dynamic QR codes encode a short redirect URL that points to a server-controlled destination, allowing URL changes post-printing but requiring ongoing server infrastructure. Error correction (L: 7%, M: 15%, Q: 25%, H: 30%) determines damage tolerance. Dynamic codes enable tracking via redirect layer analytics, while static codes require destination-side analytics integration.

What QR Codes Are: Technical Encoding

QR (Quick Response) codes are 2D barcodes that encode data in a matrix of black and white squares. Each square represents a binary bit. The code contains:

  • Position markers: Three large squares in corners for orientation detection
  • Timing patterns: Alternating modules that help scanners calculate matrix size
  • Format information: Error correction level and mask pattern metadata
  • Data region: The actual encoded content (URL, text, vCard, etc.)
  • Error correction codes: Reed-Solomon redundancy for damage tolerance

Static vs Dynamic QR Architecture

Static QR Codes

Static codes encode the destination URL directly into the QR pattern. When a user scans the code, their device decodes the pattern and opens the embedded URL immediately.

Characteristics:

  • URL is permanently embedded in the visual pattern
  • No external server dependency after generation
  • Cannot change destination after printing
  • Longer URLs create denser, harder-to-scan patterns
  • Zero ongoing cost or maintenance
  • No inherent tracking capability

Dynamic QR Codes

Dynamic codes encode a short redirect URL (e.g., short.link/abc123) that points to a server. The server maintains a database mapping each short code to a destination URL. When scanned, the redirect server logs the scan and forwards the user to the current destination.

Characteristics:

  • Short redirect URL embedded in QR pattern
  • Destination URL stored on external server
  • Destination can be changed post-printing via server update
  • Creates simpler, more scannable patterns regardless of final URL length
  • Requires ongoing server infrastructure and maintenance
  • Inherent tracking via redirect layer (time, location, device, etc.)
  • Fails permanently if redirect service shuts down

Redirect Layer Mechanics

The redirect layer is the server infrastructure that powers dynamic QR codes. When a QR code is scanned:

  1. Scanner decodes the short redirect URL from the QR pattern
  2. User's device makes HTTP request to redirect server
  3. Server logs scan metadata (timestamp, IP, user agent, referrer)
  4. Server looks up destination URL in database by short code
  5. Server returns HTTP 301/302 redirect response
  6. User's device follows redirect to final destination

This architecture introduces latency (typically 100-500ms) and a single point of failure. If the redirect service experiences downtime or shuts down permanently, all QR codes pointing to it become non-functional.

Tracking & Scan Attribution Logic

Dynamic Code Tracking:

  • Timestamp: Server logs exact scan time
  • Geolocation: Derived from IP address (city-level accuracy)
  • Device type: Parsed from user agent string (iOS, Android, desktop)
  • Browser: Extracted from user agent
  • Referrer: Source context if scan occurs via link click rather than camera
  • Campaign tagging: UTM parameters can be appended to destination URLs

Static Code Tracking:

Static codes have no inherent tracking because there's no redirect layer. Tracking requires:

  • UTM parameters embedded in the static URL itself
  • Destination website analytics (Google Analytics, Plausible, etc.)
  • Unique landing pages per QR code deployment

Error Correction Levels

QR codes use Reed-Solomon error correction to remain scannable even when partially damaged or obscured. Four levels exist:

  • L (Low): ~7% damage tolerance. Best for digital displays, pristine prints.
  • M (Medium): ~15% damage tolerance. General-purpose default.
  • Q (Quartile): ~25% damage tolerance. For industrial or outdoor environments.
  • H (High): ~30% damage tolerance. Required when embedding logos or expecting significant wear.

Higher error correction increases pattern density. If embedding a logo that covers the center of the code, use H-level correction and limit logo coverage to 10-20% of the total area.

Print Permanence vs Destination Mutability

ScenarioStatic QRDynamic QR
Permanent signageIdeal (no ongoing cost)Unnecessary complexity
Event with changing schedulePoor fit (must reprint if URL changes)Ideal (update destination remotely)
Product packagingBest for known-stable URLsOnly if tracking ROI justifies ongoing cost
Marketing campaign with A/B testingNot viableEssential for redirect-based testing

Common Deployment Mistakes

  • Using dynamic codes when static would suffice: Adds cost and single-point-of-failure risk unnecessarily
  • Printing QR codes smaller than 2cm × 2cm: Scanning failure on older devices
  • Using low error correction for outdoor signage: Weather damage renders codes unscannable
  • Not testing scans from multiple devices before mass printing: Device-specific scanning issues discovered too late
  • Embedding logos larger than 20% of code area: Exceeds error correction capacity
  • Using dynamic QR services without exit strategy: Vendor lock-in with no URL portability
  • Placing QR codes on curved or reflective surfaces: Glare and distortion prevent scanning

Buyer Checklist Before Selecting a QR Generator

  1. Do you need to change the destination URL after printing?
    • No → Use static QR codes (free, zero maintenance)
    • Yes → Requires dynamic QR infrastructure (ongoing cost)
  2. Do you need scan analytics?
    • No → Static with basic destination analytics via Google Analytics
    • Yes → Dynamic with redirect-layer tracking, or static with UTM parameters
  3. What is your print environment?
    • Digital display or pristine indoor → L or M error correction
    • Outdoor, industrial, or logo embedding → Q or H error correction
  4. What is your expected QR code lifespan?
    • Months → Dynamic acceptable if budget allows
    • Years → Static preferred (no vendor dependency risk)
  5. Do you control the destination domain?
    • Yes → Static codes work perfectly
    • No (third-party URL) → Dynamic may be required if URL structure is unpredictable

Frequently Asked Questions

What is the difference between static and dynamic QR codes?

Static QR codes encode the destination URL directly in the QR pattern itself. The URL cannot be changed after printing. Dynamic QR codes encode a short redirect URL that points to a server-controlled destination, allowing you to change where the code directs users even after printing.

Why do some QR codes stop working after printing?

Static QR codes never stop working unless the destination URL itself goes offline. Dynamic QR codes can stop working if the redirect service shuts down, your subscription expires, or the redirect server has technical issues. This is the primary risk of dynamic QR infrastructure.

What error correction level should I use for printed QR codes?

For print materials that may get damaged or dirty, use H (high) error correction which allows up to 30% of the code to be damaged while remaining scannable. For digital displays or pristine print conditions, L (low) at 7% is sufficient and creates simpler codes.