How QR Codes Work and Why They Are Everywhere in 2026
A QR code works by turning text into a grid of black and white squares that a phone camera can read in a fraction of a second.
Each square, called a module, stands for a binary 1 or 0, and the pattern as a whole stores a sequence of bits that can represent a web address, a payment, a Wi-Fi password or a contact card. They are everywhere because they cost nothing to print and any phone can read them.
Here is the short answer. A QR code is a two-dimensional barcode invented in 1994 by Denso Wave to track car parts. Three big square finder patterns in the corners let a camera lock on instantly, and Reed-Solomon error correction lets the code still scan when it is dirty, torn or partly covered.
That toughness is why restaurants, tickets, payments and posters all use them.
This guide takes a QR code apart piece by piece, explains the finder-pattern ratio and the error correction that make damaged codes scan, and covers the quishing scams that now hide inside innocent-looking codes. It also explains why a QR code is not a picture, but a grid of yes and no.
Key Takeaways
A QR code is a two-dimensional barcode: a grid of black and white modules where each dark square is a 1 and each light square is a 0.
Three finder patterns in the corners use a 1:1:3:1:1 dark-light ratio that a camera can spot instantly, at any angle or size.
Reed-Solomon error correction lets a code still scan when up to 30% is damaged, depending on the level chosen.
QR codes come in 40 sizes, from version 1 at 21 modules a side to version 40 at 177 modules a side.
QR phishing, called quishing, is a growing scam: a fake code can send you to a malicious site.
What a QR Code Really Is
A QR code, short for Quick Response code, is a two-dimensional barcode made of a square matrix of modules. Instead of using vertical bars, it arranges black and white squares in a grid to represent bits of information.
A black module usually stands for a binary 1, and a white module stands for a binary 0, and the pattern as a whole stores a sequence of bits.
It simply encodes raw data. The meaning comes from how the bits are interpreted after decoding, and that separation between the visual pattern and the data is what makes QR codes flexible.
The grids come in 40 fixed sizes, called versions. Version 1 is 21 modules by 21, which is 441 of them, and version 40 is 177 by 177, which is 31,329.
The Finder Patterns: Three Eyes That Never Miss
The three large square eyes in the corners are finder patterns, and they solve the scanner’s first problem: finding the code in a photograph. Each one is a dark square inside a light ring inside a dark ring, seven modules wide, then five, then three.
Draw a straight line through the centre in any direction, and you will cross bands of dark and light in the proportion 1:1:3:1:1.
That ratio is the clever part. The team that invented the QR code surveyed printed matter, measuring the widths of black and white in ordinary magazines and packaging, looking for a sequence that almost never turns up by accident.
Three is exactly the right number of finder patterns. Three corners of a square define the fourth, so three markers give the scanner the frame, and the corner with no marker tells it which way is up.
A fourth finder pattern would make the symbol identical under four rotations and destroy the only clue to orientation the code has.
How Text Becomes Black and White Squares
Before modules are drawn, the content must be converted into a bit stream through data encoding. QR codes support several encoding modes, including numeric, alphanumeric, byte and kanji, and the encoder chooses one or more modes based on the input.
The bits are then cut into 8-bit codewords and mapped onto the QR matrix in a zigzag pattern through the data regions. Areas reserved for structural elements, such as finder patterns, alignment patterns, timing patterns and format information, are excluded from data placement.
That disciplined layout ensures any standards-compliant scanner can reconstruct the bit sequence simply by reading the modules in order.
To keep the code readable in real-world lighting, QR codes use mask patterns. A mask selectively flips module colours according to a rule, breaking up large uniform areas that could be hard to scan.
Timing Patterns, Alignment Patterns and the Quiet Zone
Two quieter patterns handle the awkwardness of real photographs.
Running between the finder patterns, along the sixth row and the sixth column, are timing patterns: single lines of alternating dark and light modules that act like a ruler, telling the reader the exact module pitch so it can count grid lines even when the image is stretched.
Alignment patterns are smaller 5 by 5 rings that appear from version 2 upwards, with more of them in larger codes.
Format information, stored in strips beside the finder patterns, records the error correction level and the mask used.
Finally, every QR code needs a quiet zone: a plain border around the whole code. Denso Wave, the company that created the QR code, specifies a margin four modules wide on every side. Without that white space, a scanner can mistake nearby text or graphics for part of the code.
Error Correction: Why Damaged Codes Still Scan
A QR code is not built hoping it will survive. It is built assuming it will be damaged.
The repair kit is a set of extra codewords computed from the data codewords with Reed-Solomon mathematics, and a scanner can rebuild codewords lost to dirt or damage, as long as no more are lost than half the number of repair codewords.
There are four error correction levels, and the level you pick sets how big the repair kit is. Level L restores about 7% of the code, level M about 15%, level Q about 25% and level H about 30%.
That toughness is also why logos sit in the middle of so many QR codes. The centre of the code is data, and covering part of it with a logo destroys codewords that the error correction then rebuilds.
QR Codes vs Barcodes
A traditional barcode stores data in one dimension, in the width of its stripes, and it holds far less than a QR code. A QR code stores data along both axes, which is why it holds far more than the one-dimensional barcode on a cereal box.
It also scans from any angle, while a barcode must be read in a straight line.
The other difference is resilience. A damaged barcode is usually unreadable, because it has no error correction worth the name. A QR code with a torn corner or a coffee stain often still scans, because the repair codewords rebuild the missing data.
That is the practical reason QR codes replaced barcodes everywhere a code might get dirty, wet or handled roughly.
Feature
QR Code
Barcode
Data layout
Two-dimensional grid
One-dimensional stripes
Capacity
Thousands of characters
About 20 to 30 characters
Scan angle
Any angle, any rotation
Straight line only
Error correction
Up to 30% recoverable
Almost none
Data types
URLs, text, Wi-Fi, payments
Mostly product numbers
Quishing: The Scam Hiding in Plain Sight
QR phishing, called quishing, is the growing scam vector that most QR explainers skip. A fake QR code on a parking meter, a restaurant table or a parcel notice can send your phone to a malicious site that looks like your bank or a delivery company.
The code itself is harmless ink; the danger is the address it opens.
The scam works because a QR code hides its destination. With a printed link, you can read the address before you click; with a QR code, you cannot see where it goes until your phone shows you.
Protect yourself by checking the address your phone previews before you tap through, and by typing the address yourself for anything involving money or passwords.
If a QR code appears on a parking meter or a delivery note and the address looks wrong, do not scan it, and report the sticker to the business or the council.
QR Code Safety Checklist
Use this checklist every time you scan a code in the wild.
Read the preview address your phone shows before you tap, and check the domain carefully.
Never enter a password or payment details after scanning a code on a public notice or parking meter.
Check for a sticker placed over a printed code, especially on meters, menus and parcel notices.
Type the address yourself for banks, deliveries and payments instead of trusting a scanned code.
Keep your phone updated, so the built-in QR scanner warns you about known malicious addresses.
Use a higher error correction level, H or Q, when you print a code that will live outdoors or get handled.
Leave a four-module quiet zone around any code you print, or scanners may fail to lock on.
Frequently Asked Questions
How do QR codes work?
A QR code turns your text into 8-bit codewords and adds Reed-Solomon codewords computed from the data. A scanner reads the grid of black and white modules, rebuilds any codewords lost to damage, and decodes the result into a URL, text or other data.
The three finder patterns in the corners let the camera find and orient the code instantly.
Who invented the QR code?
The QR code was invented in 1994 by Denso Wave, a Japanese company, to track car parts in factories. The team, led by Masahiro Hara, needed a code that could be read fast and from any angle, and that could survive dirt and damage on a factory floor.
It is now defined by the international standard ISO/IEC 18004.
Why do damaged QR codes still scan?
Because of Reed-Solomon error correction. Extra codewords are computed from the data and stored in the code, and the scanner uses them to rebuild any codewords lost to dirt, tears or covering. Depending on the level chosen, a code can lose between 7% and 30% of its data and still scan perfectly.
What is the 1:1:3:1:1 ratio in a QR code?
It is the dark-light ratio across a finder pattern, the three big square eyes in the corners of a QR code. Draw a line through the centre of a finder pattern in any direction and you cross bands of dark and light in the proportion 1:1:3:1:1.
That ratio almost never appears in ordinary printed matter, so a camera can spot it instantly.
What is quishing?
Quishing is QR phishing: a scam where a fake QR code sends you to a malicious website, often one that imitates a bank, a delivery company or a parking service. The code hides its destination, so you cannot see where it goes until your phone previews it.
Always read the preview address before tapping, and never enter passwords after scanning a public code.
Are QR codes safe to scan?
Usually, yes, but treat them like any link. A QR code from a trusted source, such as a restaurant menu or an official poster, is normally fine.
A code on a parking meter, a parcel notice or a random sticker deserves a check: read the preview address, and type the address yourself for anything involving money or passwords.
Conclusion
QR codes work because of three clever ideas: finder patterns with a ratio that a camera can spot instantly, a grid that stores data in two dimensions, and Reed-Solomon error correction that rebuilds damaged codewords.
They are everywhere because they cost nothing to print, scan from any angle, and survive the real world better than a barcode ever could.
Ayesha is the co-founder of occcy and the editor behind its entertainment and lifestyle coverage. She believes good writing should feel like a conversation with a smart friend, clear, warm, and genuinely helpful.