How QR Codes Work: The Complete Technical Guide (2025)
guides

How QR Codes Work: The Complete Technical Guide (2025)

I
Irina
·11 min read

Learn exactly how QR codes store and transmit data. Covers encoding, error correction, scanning, and why some codes work better than others.

QR codes store data in a grid of black and white squares that smartphone cameras decode in milliseconds. But how does a pattern of pixels actually contain a website URL, contact information, or WiFi password?

This guide explains exactly how QR codes work—from encoding to error correction to scanning—so you can create codes that scan reliably every time.

What Is a QR Code?

A QR code (Quick Response code) is a two-dimensional barcode that stores data in both horizontal and vertical directions. Unlike traditional barcodes that hold about 20 characters, QR codes can store up to 4,296 alphanumeric characters.

Quick Definition

A QR code is a machine-readable optical label containing data about the item it's attached to. The "Quick Response" name comes from its design goal: fast decoding by scanning devices.

FeatureTraditional BarcodeQR Code
Data directionHorizontal onlyHorizontal + vertical
Character capacity~20 charactersUp to 4,296 characters
Data typesNumbers onlyNumbers, text, URLs, binary
Error correctionNoneUp to 30% recovery
Readable when damagedNoYes (with error correction)
2.2 billion

people worldwide actively use QR codes

Source: Juniper Research, 2025
100 million+

U.S. smartphone users will scan QR codes by 2025

Source: Statista, 2024
84%

of mobile users have scanned a QR code at least once

Source: QR TIGER, 2024

What Are the Parts of a QR Code?

Every QR code contains seven structural elements that work together to ensure reliable scanning:

1. Finder Patterns (Position Detection)

The three large squares in the corners are finder patterns. They tell the scanner "this is a QR code" and establish orientation. No matter which direction you scan from, the finder patterns ensure the code reads correctly.

Why three corners, not four? The asymmetry is intentional—it tells the scanner which way is "up."

2. Alignment Patterns

The smaller squares within the code (you'll see these in larger QR codes) help maintain accuracy when the code is curved, wrinkled, or viewed at an angle.

3. Timing Patterns

The alternating black and white lines connecting the finder patterns act as a ruler. They tell the scanner exactly how large each data module is, ensuring accurate reading regardless of print size.

4. Format Information

Two strips of data near the finder patterns contain format information: the error correction level and the data masking pattern used. This is stored redundantly so damage won't prevent scanning.

5. Version Information

For larger codes (version 7 and above), additional version data tells the scanner how much data to expect. QR codes come in 40 versions, from 21×21 modules (version 1) to 177×177 modules (version 40).

6. Data and Error Correction Region

The remaining space contains your actual data plus error correction codewords. This is where your URL, contact info, or other content lives—encoded as a pattern of black and white modules.

7. Quiet Zone

The white border around the code isn't decoration—it's essential. This quiet zone (minimum 4 modules wide) separates the QR code from surrounding visual noise, helping scanners identify where the code begins and ends.

Common Mistake

Cropping the quiet zone is one of the most common reasons QR codes fail to scan. Always maintain at least 4 modules of white space around your code.

How QR Code Encoding Works

When you create a QR code, your data goes through several transformation steps:

Step 1: Mode Selection

The encoder first analyzes your data to choose the most efficient encoding mode:

ModeBest ForCapacity (Version 40)
NumericNumbers only (0-9)7,089 characters
AlphanumericNumbers + uppercase letters + symbols4,296 characters
ByteAny ASCII character2,953 characters
KanjiJapanese characters1,817 characters

A URL like https://example.com uses Byte mode. A phone number uses Numeric mode. The encoder picks the mode that stores your data most compactly.

Step 2: Data Encoding

Your data is converted to a binary string according to the selected mode. For example, in Alphanumeric mode, each pair of characters becomes an 11-bit binary number.

Step 3: Error Correction Encoding

This is where QR codes get their resilience. The Reed-Solomon algorithm generates additional "parity" data that can reconstruct missing or damaged portions.

Four error correction levels are available:

LevelRecovery CapacityBest Use Case
L (Low)~7% damage recoveryClean environments, maximum data
M (Medium)~15% damage recoveryGeneral purpose (default)
Q (Quartile)~25% damage recoveryIndustrial use, outdoor signs
H (High)~30% damage recoveryLogos embedded in code, harsh conditions

Pro Tip

If you're adding a logo to your QR code, use error correction level H. This ensures the code remains scannable even with 30% of the pattern obscured.

Step 4: Data Placement

The encoded data is placed in the QR code following a specific zigzag pattern, starting from the bottom-right corner and moving upward in two-column segments.

Step 5: Masking

Raw encoded data often creates large blocks of same-colored modules, which can confuse scanners. Masking applies one of eight XOR patterns to break up these blocks and create a more balanced, scannable result.

The encoder tries all eight masks and selects the one that produces the most evenly distributed pattern.

How QR Code Scanning Works

When you point your phone at a QR code, here's what happens in milliseconds:

1. Detection

The camera identifies the finder patterns and confirms this is a QR code. The three-corner arrangement tells the scanner the code's size, orientation, and perspective distortion.

2. Sampling

Using the timing patterns as a guide, the scanner creates a grid and samples each module position to determine if it's black or white.

3. Format Decoding

The format information strips reveal the error correction level and which mask pattern was applied.

4. Unmasking

The scanner applies the inverse of the masking pattern to reveal the raw data.

5. Error Correction

The Reed-Solomon algorithm checks for and corrects any errors in the data. If damage is within the error correction level's capacity, the full data is recovered.

6. Data Decoding

Finally, the binary data is converted back to its original format—your URL, text, contact info, or other content.

This entire process takes 50-200 milliseconds on modern smartphones.

What's the Difference Between Static and Dynamic QR Codes?

Understanding how QR codes work helps explain the difference between static and dynamic codes:

Static QR codes encode data directly into the pattern. A URL QR code literally contains every character of your web address in its modules. Change the URL, and you need a completely new code.

Dynamic QR codes encode a short redirect URL (like qrc.gs/abc123) that points to your actual destination. The code itself never changes—only where the redirect points.

AspectStatic QR CodeDynamic QR Code
Data locationEncoded directly in codeShort URL redirects to destination
Editable after printNoYes
Scan trackingNot possibleFull analytics available
Pattern complexityHigher (more data = more modules)Lower (short URL = simpler pattern)
Best forPermanent content, offline useMarketing campaigns, updateable content

Why Dynamic Codes Scan Better

Because dynamic codes encode a short URL instead of your full destination, they use fewer modules and larger patterns. This makes them more reliable to scan, especially at small sizes or from a distance.

Why Some QR Codes Fail to Scan

Now that you understand how QR codes work, you can avoid the common causes of scanning failures:

Insufficient Contrast

Scanners distinguish modules by contrast, not color. A light gray on white code will fail even if it's technically "correct." Maintain at least 40% brightness difference between foreground and background.

Code Too Small

Each module needs to be large enough for the camera to resolve. Minimum size depends on scanning distance:

Scanning DistanceMinimum QR Code Size
10 cm (4 inches)2 cm × 2 cm
30 cm (1 foot)3 cm × 3 cm
1 meter (3 feet)10 cm × 10 cm
3 meters (10 feet)30 cm × 30 cm

Damaged Quiet Zone

If anything encroaches on the white border—even a thin frame—scanning reliability drops significantly.

Too Much Data

More data means more modules, which means smaller individual modules at any given code size. If you're encoding a long URL, consider using a URL shortener or dynamic code to keep the pattern simple.

Poor Print Quality

Ink bleed, low resolution printing, or glossy surfaces that create glare can all prevent successful scanning. Always test your codes on the actual printed material before mass production.

Frequently Asked Questions

How much data can a QR code hold?

A QR code can hold up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data. However, more data means more complex patterns that are harder to scan at small sizes.

Can QR codes work without internet?

Static QR codes containing text, contact information, or WiFi credentials work completely offline—the data is encoded directly in the pattern. Dynamic QR codes require internet access because they redirect through a server.

Why do QR codes have three squares in the corners?

The three finder patterns establish orientation. The asymmetric arrangement (three corners, not four) tells the scanner which direction is "up" so the code can be read from any angle.

Can a damaged QR code still work?

Yes, if it was created with sufficient error correction. Level H codes can recover from up to 30% damage. This is why you can add logos to QR codes—the error correction fills in the obscured data.

How long do QR codes last?

Static QR codes last forever—they're just patterns with encoded data. Dynamic QR codes depend on the redirect service remaining active. At QR Code Maker, static codes are always free and never expire, and we provide clear notice before any changes to dynamic codes.

Do I need a special app to scan QR codes?

No. Since 2017 (iOS 11) and 2018 (Android), smartphone cameras have built-in QR code scanning. Just open your camera, point it at the code, and tap the notification that appears. No third-party app required.

What happens if I scan a QR code upside down?

It still works. The three finder patterns (large squares in the corners) tell the scanner which way is "up." QR codes can be read from any angle—even rotated 180 degrees—because the asymmetric corner arrangement establishes orientation.

How Do You Create Reliable QR Codes?

Understanding how QR codes work helps you create codes that scan reliably every time. The key principles: maintain contrast, preserve the quiet zone, match error correction to your use case, and test before printing.

For practical applications, see our guides on WiFi QR codes for sharing network access or restaurant menu QR codes for hospitality use cases.

Ready to create your first QR code? Start with our free QR code generator—no credit card required, and your static codes never expire.

Ready to create your QR code?

Free forever for static codes. Pro features with 14-day trial, no credit card required.

Create QR Code
qr-codeshow-it-workstechnicalencoding
Share:
I

Irina

·Content Lead

Irina leads content strategy at QR Code Maker, helping businesses understand how to leverage QR codes for marketing, operations, and customer engagement. Her expertise spans digital marketing, user experience, and practical implementation guides.

Learn more about us →

Related Articles