Skip to main content
Back to Blog

How QR Codes Work: Error Correction and Data Density

How QR codes encode URLs and text, what error correction does, and how to generate codes that scan reliably every time.

Kashyap Thakar
5 min
TechnologyQR CodeMobile
How QR Codes Work: Error Correction and Data Density

The Quick Response (QR) code was invented in 1994 by Denso Wave to track automotive parts. Today, it's the bridge between the physical and digital worlds, appearing on everything from restaurant menus to billboards.

The Matrix Structure

Unlike a 1D barcode that only stores data horizontally, a QR code is a 2D matrix. This allows it to store significantly more information up to 7,089 numeric characters or 4,296 alphanumeric characters.

The three large squares in the corners are "Finder Patterns". They tell the scanner: "Hey, I'm a QR code, and here's my orientation." This is why you can scan a QR code upside down, and it still works instantly.

The Magic of Error Correction

Have you ever seen a QR code with a logo in the middle? How does that not break the code?

QR codes use Reed-Solomon error correction. This adds redundant data to the code, allowing it to remain readable even if part of it is damaged or covered.

  • Level L (Low): Restores ~7% of data. Good for clean, digital codes.
  • Level M (Medium): Restores ~15% of data. The standard for most uses.
  • Level Q (Quartile): Restores ~25% of data.
  • Level H (High): Restores ~30% of data. Essential if you plan to put a logo in the center or print it on a crumpled surface.

Static vs. Dynamic QR Codes

Static codes encode the data directly. If you encode a URL and that URL changes, the printed code is useless.

Dynamic codes encode a short redirection URL. This allows you to change the destination website without reprinting the QR code a lifesaver for marketing campaigns.

Data Capacity by Version

QR codes come in 40 versions, with each version having more data capacity:

VersionSize (modules)NumericAlphanumeric
121×214125
1057×57652395
40177×1777,0894,296

QR Code Structure Components

Finder Patterns

The three large squares in the corners. They help scanners:

  • Detect that this is a QR code
  • Determine orientation (can be scanned at any angle)
  • Calculate the size and version of the code

Alignment Patterns

Smaller squares that help correct distortion when the code is scanned at an angle or printed on a curved surface.

Timing Patterns

Alternating black and white modules that help determine the coordinate system and module size.

Format Information

Contains error correction level and mask pattern information, allowing the scanner to decode the data correctly.

Choosing Error Correction Level

The error correction level you choose affects both data capacity and scan reliability:

  • Level L (Low): Best for clean, digital displays. Smallest code size.
  • Level M (Medium): Good balance. Standard for most applications.
  • Level Q (Quartile): Better for printed materials that might get damaged.
  • Level H (High): Essential for codes with logos, damaged prints, or outdoor use.

Higher error correction means larger codes but better reliability. For marketing materials with logos, always use Level H.

QR Code Use Cases

Payment QR Codes

UPI, Google Pay, and other payment systems use QR codes to encode payment information. These codes contain structured data like merchant ID, amount, and transaction notes.

Wi-Fi Network Sharing

QR codes can encode Wi-Fi credentials in a standard format: WIFI:T:WPA;S:NetworkName;P:Password;;

Contact Information (vCard)

QR codes can store contact information in vCard format, allowing instant contact sharing.

URLs and Deep Links

The most common use case - encoding URLs that open websites or mobile apps. Perfect for marketing campaigns and physical-to-digital bridges.

Best Practices for QR Code Generation

  • Use appropriate error correction: Higher levels for printed materials or codes with logos
  • Ensure sufficient size: Codes should be at least 2cm×2cm (0.8in×0.8in) for reliable scanning
  • Maintain quiet zone: Leave white space around the code (4 modules minimum)
  • Test before printing: Always test QR codes with multiple devices and apps
  • Consider contrast: High contrast between code and background improves scan reliability

Create Your Own

Want to share your Wi-Fi password, website link, or payment information? Use our QR Code Generator. It supports:

  • Custom colors and gradients for branding
  • Adjustable sizes for different use cases
  • All error correction levels (L, M, Q, H)
  • Payment QR codes for UPI and other payment systems
  • High-quality PNG downloads

All QR codes are generated client-side, ensuring your data remains private. Whether you're creating codes for marketing materials, business cards, or payment systems, our generator ensures your codes look great and scan perfectly.

Part of the ThenCatch blog. Learn more about us or browse more guides.