All Posts

How QR Codes Work: The Technology Behind the Square

Every QR code is a miniature data storage system. Understanding how they encode URLs, handle damage, and communicate with your phone camera reveals elegant engineering that has stood the test of time since 1994.

The Anatomy of a QR Code

A QR code is a two-dimensional barcode made up of black and white modules (squares) arranged in a grid. Unlike traditional barcodes that store data in one direction, QR codes encode information both horizontally and vertically — which is where the name comes from: Quick Response.

Every QR code has three large squares in the corners called finder patterns. These allow your phone camera to locate and orient the code regardless of angle. Between the finder patterns are alignment patterns, timing patterns, and the actual data modules. A quiet zone (blank border) surrounds the code so scanners can distinguish it from its background.

The format information area near the finder patterns tells the scanner which error correction level was used and which masking pattern was applied. This metadata is critical for correct decoding. For practical sizing advice based on these structural elements, see our size guide at honestqr.net/blog/qr-code-size-guide-minimum-print-size.

How Data Gets Encoded

QR codes support four encoding modes: numeric (digits only, most compact), alphanumeric (digits, uppercase letters, and a few symbols), byte (any character via ISO 8859-1 or UTF-8), and kanji (Japanese characters). The encoder chooses the most efficient mode for the data.

For a URL like "https://honestqr.net", the encoder uses byte mode. The data is converted to binary, split into 8-bit codewords, and then processed through Reed-Solomon error correction to generate additional codewords that protect against damage. The total data — original plus error correction — is then mapped onto the module grid.

There are 40 QR code versions (sizes), ranging from 21x21 modules (Version 1) to 177x177 modules (Version 40). A Version 1 code can hold about 25 alphanumeric characters, while Version 40 can hold over 4,000. Most URL-based QR codes use versions 2 through 6.

Error Correction: Why Damaged QR Codes Still Scan

QR codes use Reed-Solomon error correction, the same algorithm used in CDs and satellite communications. There are four error correction levels: L (7% recovery), M (15%), Q (25%), and H (30%). A code with Level H can lose nearly a third of its modules and still be readable.

This is why you can place a logo in the center of a QR code and it still works — the logo covers some modules, but error correction fills in the gaps. However, there are limits. Cover too much, or damage the finder patterns, and the code becomes unreadable.

Most generators default to Level M (15% recovery), which balances data capacity with resilience. If you plan to add a logo or print on a surface that might get scuffed, Level H is the safer choice — though it produces a denser code because the extra error correction data takes up more space. We cover the full logo overlay process at honestqr.net/blog/how-to-add-logo-to-qr-code.

How Your Phone Camera Reads QR Codes

Modern smartphones use computational photography to detect and decode QR codes in real time. The process happens in milliseconds: the camera feed is analyzed frame by frame, looking for the distinctive finder patterns (the three large squares).

Once the finder patterns are located, the software calculates the code's size, orientation, and perspective distortion. It then samples each module position to determine black or white, reads the format information to identify the error correction level and masking pattern, unmasks the data modules, and decodes the binary content.

Apple added native QR scanning to the iPhone camera in iOS 11 (2017), and Android followed with Android 9 (2018). Before that, users needed a separate scanning app — which was a major friction point that held back QR code adoption in Western markets for years.

Static vs. Dynamic: What Changes the Architecture

A static QR code encodes the destination URL directly into the module pattern. The URL is literally baked into the image. Change the URL, and you need a completely new QR code.

A dynamic QR code encodes a short redirect URL instead. When scanned, the redirect server looks up the current destination and forwards the user. The QR code itself never changes, but the destination can be updated as many times as needed.

Dynamic codes are typically smaller (fewer modules) because the redirect URL is shorter than the final destination URL. They also enable scan tracking, since every scan passes through the redirect server. Honest QR offers free static codes and dynamic codes starting at $19 one-time for the Pro plan — no monthly fees. For a detailed breakdown of when to choose each type, read our guide at honestqr.net/guides/static-vs-dynamic-qr-codes.

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 at maximum size (Version 40). However, most practical QR codes use smaller versions. A typical URL QR code holds 50-200 characters comfortably.

Why do QR codes have three squares in the corners?

The three squares are finder patterns. They allow the scanner to locate the QR code and determine its orientation regardless of how the code is rotated. The asymmetric placement (three corners, not four) tells the scanner which way is up.

Can a QR code work if part of it is damaged?

Yes, thanks to Reed-Solomon error correction. Depending on the error correction level, a QR code can lose 7% to 30% of its data and still scan correctly. This is why QR codes with logos in the center still work — the error correction compensates for the covered modules.

Ready to create your QR code?

Free static QR codes with a free account. Dynamic codes from $19 lifetime.