How do QR codes work? A QR code is a two-dimensional pattern of small squares that stores information in a form a camera or specialised scanner can recognise. The device analyses the pattern, decodes the information and then offers an appropriate action, such as opening a website, displaying text or connecting to a wireless network.
QR codes appear on product packaging, transport tickets, restaurant menus, advertisements and payment systems around the world. Despite their simple appearance, they combine a carefully designed visual structure with mathematical error correction, allowing information to be read quickly and sometimes even when part of the code is damaged.
What Is A QR Code?
QR stands for Quick Response, reflecting the aim of creating a code that could be read rapidly.
Unlike a conventional barcode, which generally stores information through the widths and spacing of parallel lines, a QR code uses a square arrangement of dark and light modules.
A module is one of the individual squares that make up the pattern.
Because information is arranged in two dimensions, a QR code can hold substantially more data than many traditional one-dimensional product barcodes.
QR codes can contain different kinds of information, including website addresses, plain text, contact details and data used by particular applications.
Importantly, a QR code does not need to contain a website address. It can store information directly without requiring an internet connection to decode it.
Who Invented The QR Code?
The QR code was developed in Japan by engineers working for DENSO, the automotive components manufacturer, and was released in 1994.
The development was led by Masahiro Hara, whose small team wanted to overcome limitations encountered when tracking parts in manufacturing.
Traditional barcodes could store only relatively small amounts of information, and workers sometimes had to scan multiple codes to identify products and manufacturing details.
The new code needed to hold more information, occupy a relatively small space and remain easy to read at different angles.
The engineering team developed a pattern that incorporated distinctive position markers, enabling scanners to locate and orient the code quickly.
The invention initially served industrial needs, particularly the management of automotive components.
As compatible scanning equipment and mobile phones became more widespread, QR codes spread into retailing, transport, advertising and everyday public use.
The original development illustrates how a technology created to solve a manufacturing problem eventually became useful across many industries.
What Do The Squares In A QR Code Mean?
A QR code is not simply a random arrangement of black and white squares.
Different parts of the pattern perform different functions, helping a scanner recognise the code, determine its orientation and reconstruct the stored information.
The Three Large Corner Squares
Most ordinary QR codes contain three prominent square patterns positioned at three corners.
These are called finder patterns or position detection patterns.
They help scanning software establish where the code begins, how it is rotated and how its grid should be interpreted.
The fourth corner normally does not contain the same large finder pattern because the three existing markers are sufficient for determining orientation.
Alignment And Timing Patterns
Other elements help the scanner identify the positions of individual modules.
Alignment patterns assist with correcting distortion, which can occur when a code is photographed from an angle or printed on a slightly uneven surface.
Timing patterns consist of alternating dark and light modules. They help the reader establish the spacing and arrangement of the grid.
The number of alignment patterns depends on the size and version of the code.
The Data And Error Correction Areas
Much of the remaining pattern contains encoded data and information used for error correction.
The code also includes formatting information that tells the scanner how to interpret the symbol.
The visible squares therefore represent several types of information working together, not just a direct picture of the message being stored.
How Does A Phone Read A QR Code?
When a phone scans a QR code, its camera captures an image of the pattern.
The scanning software then performs several operations.
- Recognising the code: The software searches the camera image for the distinctive finder patterns.
- Determining orientation: It establishes the code’s position and corrects for rotation or perspective.
- Reading the grid: The software identifies the arrangement of dark and light modules.
- Decoding the information: It interprets the stored data using the QR code’s encoding rules and error correction information.
- Presenting a result: The device displays the decoded text or offers an action appropriate to the content.
For example, if the code contains a website address, the phone may display a link that the user can choose to open.
If it contains contact information, a compatible application may offer to create a contact.
The exact interface depends on the device, operating system and scanning application.
The essential process, however, remains the same: the scanner converts a visual pattern into digital information.
How Is Information Stored Inside A QR Code?
Each module in a QR code contributes to a larger pattern of encoded information.
The data is converted into binary form, using combinations of zeros and ones that can be represented by dark and light modules.
The encoding process also includes information identifying the type and length of the stored data.
QR codes support several encoding modes, including numeric, alphanumeric, byte and kanji modes.
These modes allow certain types of information to be represented more efficiently than others.
For example, a sequence containing only digits can generally be encoded more compactly than the same number of arbitrary text characters.
The code also uses masking rules to avoid visual patterns that might make scanning more difficult. The scanner reverses the selected masking process when decoding the symbol.
Consequently, the arrangement of squares is not a straightforward letter-by-letter transcription of the content.
It is the result of several encoding and formatting steps designed to make the information both compact and reliably readable.
Why Do QR Codes Have Three Large Squares?
One of the most distinctive features of a QR code is the arrangement of large square markers at three corners.
Their appearance was not chosen simply because squares looked attractive.
During the original development, DENSO’s engineers studied patterns found in printed materials to identify a design that scanners would be unlikely to confuse with surrounding text or illustrations.
They selected a particular sequence of dark and light widths, expressed as 1:1:3:1:1, through the centre of each finder pattern.
This distinctive ratio helps scanning software recognise the markers and establish the code’s orientation.
The design supports rapid reading even when the code is rotated.
The three markers were therefore a key part of the original invention, helping QR codes achieve the quick response for which they were named.
How Much Information Can A QR Code Hold?
The amount of information a QR code can contain depends on its size, the type of data and the error correction setting.
Standard QR codes have 40 versions, representing different grid sizes.
Version 1 uses a grid of 21 by 21 modules.
Version 40, the largest standard version, uses 177 by 177 modules.
The maximum capacities of a standard Version 40 QR code at the lowest error correction level are approximately:
| Data type | Maximum capacity |
|---|---|
| Numeric | 7,089 digits |
| Alphanumeric | 4,296 characters |
| Binary | 2,953 bytes |
| Kanji | 1,817 characters |
These figures are maximum capacities under specific conditions, not the amount available in every QR code.
Choosing stronger error correction reduces the space available for the original data.
In everyday use, many codes store comparatively short pieces of information, such as a web address, rather than large documents.
Why Can A Damaged QR Code Still Work?
QR codes include a mathematical technique called Reed-Solomon error correction.
This adds redundant information that can help a scanner reconstruct data when part of the symbol is unreadable.
There are four commonly used error correction levels:
| Level | Approximate restoration capability |
|---|---|
| L | 7% |
| M | 15% |
| Q | 25% |
| H | 30% |
These percentages refer to the approximate proportion of codewords that can be restored, not a guarantee that the same percentage of any visible QR code can be covered or destroyed.
The location and type of damage matter.
For example, a code may still scan if some data modules are obscured, but damage to critical recognition patterns may prevent the scanner from locating the code in the first place.
Higher error correction settings also require more space for redundant information.
This is why QR codes can sometimes remain readable despite scratches, dirt or other minor damage, but they are not indestructible.
Why Do Some QR Codes Fail To Scan?
Even an undamaged QR code may be difficult to read if it is displayed or printed poorly.
Common causes include:
- Insufficient contrast between the dark and light modules.
- Printing the code too small for the scanner or viewing distance.
- Blurring, glare or reflections.
- Distortion caused by stretching or uneven surfaces.
- Damage to important positioning patterns.
- Insufficient blank space around the outer edge.
- Poor camera focus or inadequate lighting.
A standard QR code requires a clear border, known as the quiet zone, equivalent to four modules on each side.
This empty margin helps the scanner distinguish the code from surrounding text or graphics.
Decorative logos, colours and unusual shapes can also make a code harder to read if they interfere with its essential structure.
For reliable results, a QR code should preserve adequate contrast, a clear quiet zone and enough detail for the intended scanning distance.
Do QR Codes Need The Internet?
No. A QR code can be decoded without an internet connection.
The information is stored in the visible pattern itself.
For example, a code containing a short piece of text can be scanned and read entirely offline, provided the device has suitable scanning software.
However, the action offered after scanning may require a connection.
If the code contains a website address, the phone can decode that address offline, but it normally needs internet access to retrieve the website.
Similarly, a QR code used by a ticketing or payment application may be decoded locally while additional verification takes place through an external service.
The distinction is between reading the information and using an online service referenced by that information.
Are All QR Codes The Same?
Not every square machine-readable symbol is a standard QR code.
Other two-dimensional barcode systems exist, including Data Matrix and Aztec codes.
They use different structures and may be selected for particular industrial, transport or identification purposes.
Within the QR code family, variations also exist for different applications and space requirements.
For example, Micro QR codes are designed for situations where the available printing area is restricted.
A device that reads one type of two-dimensional barcode does not necessarily support every other type.
Compatibility depends on the decoding software and the formats it recognises.
What Is The Difference Between Static And Dynamic QR Codes?
The terms static and dynamic QR code are commonly used to describe how a code’s destination or content is managed.
A static QR code contains information that remains fixed once the symbol has been generated.
For example, a static code might directly encode a website address or a short message.
A dynamic QR code usually contains a link to a redirecting service. The service can change the eventual destination without changing the printed QR code.
This can be useful when printed materials need to remain in circulation while the linked content changes.
However, dynamic codes may depend on an external service remaining available.
They can also introduce additional data collection or tracking if the service records scans.
The QR pattern itself does not necessarily reveal whether such tracking occurs.
Importantly, a dynamic QR code does not rewrite its own stored data. The information inside the printed symbol remains unchanged; the redirection service controls what happens after the link is opened.
Are QR Codes Safe To Scan?
A QR code is a way of storing and transferring information. It is not, by itself, proof that the information or destination is trustworthy.
A code may contain a legitimate website address, but it can also direct someone towards a fraudulent website.
Criminals have been known to place their own QR code stickers over legitimate codes on payment signs, including public parking equipment.
A malicious destination may imitate a familiar organisation and attempt to obtain passwords, payment details or other personal information.
The safest approach is to treat an unfamiliar QR code with the same caution as an unfamiliar web link.
- Check the destination address before opening it, where the scanning application provides a preview.
- Be cautious of unexpected codes received through messages or emails.
- Check that printed codes have not been covered by suspicious stickers.
- Avoid entering passwords or payment information on websites whose identity cannot be verified.
- When paying or accessing a sensitive account, consider opening the organisation’s known official website or application directly.
- Keep the device and scanning applications updated.
A code printed on an official-looking sign does not guarantee that the destination is genuine.
Scanning a QR code also does not automatically mean that a website has received your personal information. What information may be collected depends on the scanner, any subsequent website or application, and whether the user opens or interacts with it.
Why Are QR Codes Used Around The World?
QR codes became widely useful because they connect physical objects with digital information without requiring people to type long addresses or reference numbers.
They can be printed on paper, packaging and signage or displayed electronically.
Their ability to hold different types of data makes them suitable for many purposes.
Common examples include transport tickets, product identification, digital menus, event admissions, equipment tracking, contact information and payments.
Their widespread adoption was encouraged by DENSO WAVE’s decision to make the technical specifications publicly available and waive the exercise of its patent rights for standardised QR codes. QR codes gained international standardisation in 2000, helping the technology spread beyond Japan.
The technology originated in Japan, but it does not depend on a particular language or national postal or telecommunications system.
That flexibility helped it become a globally recognised method of exchanging information.
The Lasting Importance Of QR Codes
The QR code was developed to solve a practical problem in manufacturing: how to store more information in a compact symbol while allowing it to be read quickly and reliably.
Its success came from combining an efficient two-dimensional format with distinctive position markers, several encoding methods and error correction.
The same principles now support uses far beyond industrial production.
Understanding the difference between the code itself and the action it triggers is particularly important. A QR code can be read without internet access, can store information other than website addresses and can be technically valid without its destination being trustworthy.
Ultimately, QR codes are not mysterious images. They are carefully structured arrangements of data that allow printed and digital information to be recognised by machines.
Join The Discussion
Have QR codes made everyday tasks easier, or are there situations where you would rather use a traditional menu, ticket or web address?
Share your experiences, including useful applications or problems you have encountered, in the For More Details Forum.
Sources And Further Reading
- DENSO WAVE – History Of QR Code – The development of QR codes, Masahiro Hara’s team and the original finder-pattern design.
- DENSO WAVE – Information Capacity And Versions – Official specifications for QR code versions, sizes and storage capacity.
- DENSO WAVE – Error Correction Feature – Explanation of error correction levels and Reed-Solomon coding.
- DENSO WAVE – Securing The QR Code Quiet Zone – The blank margins required for reliable scanning.
- International Organization For Standardization – ISO/IEC 18004 – The international standard covering QR code structures, encoding and decoding.
- US Federal Trade Commission – Scammers Hide Harmful Links In QR Codes – Consumer guidance on fraudulent QR codes and safer scanning.
QR Code is a registered trademark of DENSO WAVE INCORPORATED.

