How QR Codes Work: Anatomy, Error Correction and Capacity Explained
What actually happens when your phone reads a QR code? A clear guide to finder patterns, modules, versions, error correction levels and how much data a QR code can hold.
Published 6 min read
QR codes are everywhere — on restaurant tables, parcels, train tickets, business cards and payment terminals. Yet few people know what is hidden inside those black-and-white squares, or why a code still works when part of it is covered by a logo. This guide explains how QR codes work, in plain language.
A short history
The QR code (short for Quick Response code) was invented in 1994 by Masahiro Hara at Denso Wave, a Toyota group company in Japan. Car factories needed to track parts faster than one-dimensional barcodes allowed. A classic barcode stores data in one direction only and holds around 20 characters; a QR code stores data both horizontally and vertically and can hold several thousand.
Denso Wave patented the technology but chose not to enforce the patent, and the format became an international standard (ISO/IEC 18004). That openness is the main reason QR codes can be generated and read by anyone, for free, on any device.
The anatomy of a QR code
Every QR code is a square grid of small cells called modules. Each module is either dark or light and represents one bit. Some areas of the grid have fixed jobs:
- Finder patterns — the three large squares in the corners. They let a scanner find the code instantly and work out its orientation, even when the code is upside down or photographed at an angle.
- Alignment patterns — smaller squares (from version 2 upwards) that help correct distortion when the code is printed on a curved surface or seen in perspective.
- Timing patterns — alternating dark and light lines between the finder patterns. They tell the scanner how big each module is.
- Format information — strips next to the finder patterns that store the error-correction level and the mask pattern used.
- Quiet zone — the empty margin around the code. It is part of the specification: without it, a scanner cannot tell where the code ends and the background begins.
Everything else is data and error-correction codewords, interleaved across the grid.
Versions: why some codes are denser
QR codes come in 40 sizes called versions. Version 1 is 21 × 21 modules; each version adds 4 modules per side, up to version 40 with 177 × 177 modules. The more data you encode, the higher the version and the smaller each module becomes at a given print size.
That is why a short URL produces a clean, open pattern, while a long block of text produces a dense one that needs to be printed larger. When you generate a code on our QR code generator, the preview shows the version and module count so you can keep an eye on density.
Encoding modes and capacity
A QR code picks the most efficient encoding mode for your content:
| Mode | Characters | Max. capacity (version 40, level L) |
|---|---|---|
| Numeric | 0–9 | 7,089 digits |
| Alphanumeric | 0–9, A–Z, space and $%*+-./: |
4,296 characters |
| Byte | Any data, usually UTF-8 text | 2,953 bytes |
| Kanji | Japanese characters | 1,817 characters |
Those are theoretical maximums. In practice, codes stay reliable to scan up to a few hundred characters. If you need to share more, encode a short link to a web page instead.
Error correction: the secret behind logos
QR codes use Reed–Solomon error correction, the same mathematics that lets scratched CDs and DVDs keep playing. Extra codewords are added so that the original data can be rebuilt even if part of the code is damaged, dirty or hidden. There are four levels:
- L (Low) — recovers about 7% of damaged codewords
- M (Medium) — about 15%
- Q (Quartile) — about 25%
- H (High) — about 30%
Higher levels make the code more robust but also larger, because more space is spent on redundancy. This is exactly what makes logo QR codes possible: a logo in the centre “damages” part of the code on purpose, and error correction fills in the gap. For a logo, choose level Q or H and keep it below roughly a quarter of the code’s area.
Tip: error correction is not a substitute for good contrast. A code that is too light, too small or missing its quiet zone can fail even at level H.
Masking: keeping patterns readable
Raw data can accidentally create large blocks of one colour or shapes that look like finder patterns, which confuses scanners. To prevent this, the encoder applies one of eight mask patterns — mathematical formulas that flip certain modules — and keeps the one with the lowest “penalty score”. The scanner reads the mask number from the format information and reverses it. You never have to think about masks, but they are why two codes with almost identical content can look completely different.
What happens when you scan
When you point your camera at a QR code, the scanner:
- Finds the three finder patterns and calculates the code’s position, size and rotation.
- Corrects perspective using the alignment patterns, so a tilted code becomes a flat grid.
- Samples each module as dark or light, using the timing patterns as a ruler.
- Reads the format information, removes the mask and collects the codewords.
- Repairs errors with Reed–Solomon decoding.
- Interprets the data — a link, Wi-Fi credentials, a contact card — and offers the right action.
All of this takes a few milliseconds. You can try it yourself with our online QR code scanner, which runs these steps directly in your browser on an uploaded image, a link or your camera.
Static vs. dynamic QR codes
A static QR code contains the final content directly: the URL, the Wi-Fi password or the text itself. It works forever, needs no server and cannot be tracked. A dynamic QR code contains a short redirect link owned by a service provider, which lets you change the destination later and count scans — but it stops working if the subscription ends.
Every code made on QR.tools is static: free, private and permanent. If you need to change the destination later, point the code at a page you control and update that page instead.
What can a QR code contain?
Because a QR code simply stores text, the format of that text decides what the phone does with it. Standardised formats include:
- URLs — open a website (
https://…) - Wi-Fi — join a network (
WIFI:T:WPA;S:…;P:…;;) — see the Wi-Fi QR code generator - vCard — save a contact — see the vCard QR code generator
- Email, SMS and phone — start a message or a call with
mailto:,SMSTO:andtel: - Calendar events — add an event with an iCalendar
VEVENT - Geo locations — open a map with
geo:coordinates
Key takeaways
- A QR code is a grid of modules with fixed finder, timing and alignment patterns around your data.
- More content means a higher version, denser pattern and bigger minimum print size.
- Error correction (L, M, Q, H) lets codes survive damage — and makes logos possible.
- Static codes are permanent and private; dynamic codes are editable but depend on a provider.
Ready to make one? Open the QR code generator and create a code with your own colours and logo in seconds.
Ready to create your own QR code?
Design a custom QR code with your logo and colors in seconds — free and without sign-up.
Open the generator