A QR code is a two-dimensional barcode that stores information in a square grid of dark and light modules. A phone camera or barcode reader captures the pattern, identifies its orientation, corrects for perspective, reads the encoded data and turns it into something useful, such as a website address, text, contact details or a product identifier.
QR codes look simple, but the square pattern is carefully structured. Some areas help the scanner locate and align the symbol. Other areas describe the encoding and error-correction settings. The remaining modules carry the data and redundancy needed to recover it when part of the printed symbol is dirty or damaged.
This guide explains the technology from first principles: what the squares represent, how information is encoded, why there are different versions and error-correction levels, how a camera reads a code, what makes a QR code difficult to scan, and how to avoid QR-based phishing. It also looks at retail and product identification, including GS1 Digital Link, without confusing those specialised applications with ordinary QR links.
1. What does QR stand for?
QR means Quick Response. The system was developed by DENSO WAVE in Japan in 1994. The original design addressed the need to read more information quickly and reliably than a conventional one-dimensional barcode could conveniently hold. QR codes became widely used because a compact square can carry data in both horizontal and vertical directions and can be read from different orientations.
A traditional one-dimensional barcode uses bars and spaces arranged along one axis. A scanner measures their widths to recover the encoded number or identifier. A QR code is a matrix barcode: its data is represented by a two-dimensional arrangement of small square units called modules. This arrangement allows it to store more information in a compact area, depending on the selected version and data type.
QR Code is a standardised symbology, not a single website service or a special kind of internet connection. A QR code can contain a URL, plain text, a payment payload, a Wi-Fi configuration string or structured product information. Scanning it does not inherently require the internet; whether an internet connection is needed depends on what the encoded data asks the phone to do.
2. What information can a QR code contain?
A QR code stores data, not an application by itself. The content may be:
- Numeric data: digits such as an identifier or reference number.
- Alphanumeric data: supported letters, numbers and selected punctuation in the QR alphanumeric character set.
- Byte data: bytes representing text or other data using an agreed character encoding.
- Kanji data: a mode designed for efficient encoding of characters from the supported Shift JIS repertoire.
- Structured data or a URI: information arranged according to an application convention, such as a web address or GS1 Digital Link.
For a common consumer example, a code may contain a URL such as https://example.com/menu. The scanner decodes that text and offers to open it. The QR code does not contain the restaurant website itself, and it does not prove that the destination is trustworthy. It simply carries the encoded string.
Other QR codes may contain contact-card data, calendar information, email addresses, phone numbers or Wi-Fi configuration text. The phone's camera or scanning software recognises the payload format and offers an action. Different operating systems and scanner apps may support different payload types.
There is a practical distinction between data stored directly in the symbol and data retrieved later. A code containing a short text message can be decoded offline. A code containing a URL needs a network connection only when the user chooses to visit the page. A product identifier may be resolved against a database or web service to retrieve current product details.
3. What are the black and white squares?
The smallest square element is called a module. Each module is represented as dark or light in the printed symbol. The pattern is not a random picture. It contains function patterns that help the reader find the code, determine its size and orientation, and interpret the data correctly.
Three large square finder patterns are placed near three corners of a standard QR Code symbol. They help a camera detect the symbol and establish its orientation. Their distinctive nested pattern is designed to be recognised even when the code is rotated. This is why a QR code can usually be scanned without carefully aligning its top edge with the phone.
Timing patterns run between key finder regions and help the reader determine the module grid. Alignment patterns, present in larger versions, help correct geometric distortion and perspective, especially when the code is viewed at an angle or printed on a surface that is not perfectly flat. The exact arrangement depends on the QR Code version.
Other reserved areas carry format information and, in larger versions, version information. These tell the decoder which error-correction level and masking pattern were used and help identify the symbol's dimensions. The remaining data region carries encoded data and error-correction codewords, interleaved according to the specification.
A QR code also needs a clear border called the quiet zone. This blank margin separates the symbol from nearby text, graphics, borders or other codes. If a designer crowds the code with a logo, frame or decorative pattern, the scanner may mistake nearby content for part of the symbol or fail to locate its boundaries.
4. How does a QR code store information?
A QR encoder first converts the input into a sequence of bits. It selects an appropriate data mode, determines how many characters or bytes are present, adds the required mode and length information, and then produces data codewords. Error-correction codewords are calculated and added. The resulting codewords are placed into the data region in the order defined by the QR specification.
Data is not simply written as a line of binary digits from the top-left corner to the bottom-right. The QR layout reserves the function patterns first. The encoder places data through the remaining modules in a defined zigzag path, skipping reserved areas. It then applies a mask pattern to avoid problematic visual patterns and improve the reliability of scanning. The chosen mask is recorded in the format information.
Why use modes? Numeric digits can be represented more efficiently than arbitrary bytes, and the alphanumeric mode can be efficient for its supported character set. If the content mixes different types of characters, an encoder may switch modes to use capacity efficiently. The best encoding depends on the actual text and the character set used.
Character encoding matters. A QR symbol stores bits and bytes; it does not automatically know how every device should interpret every character. If text uses a particular encoding, the reader must interpret it consistently. This is especially relevant for accented characters, non-Latin scripts and multilingual payloads. A code can scan successfully yet display garbled text if the encoder and decoder disagree about character interpretation.
5. QR Code versions and data capacity
Standard QR Code Model 2 defines 40 versions. Version 1 is 21 by 21 modules. Each next version adds four modules to each side, reaching Version 40 at 177 by 177 modules. A higher version provides more data capacity, but it also creates a denser pattern when printed at the same physical size.
The maximum capacity depends on the data mode and error-correction level. DENSO WAVE lists maximum capacities for Version 40 of up to 7,089 numeric characters, 4,296 alphanumeric characters, 2,953 bytes or 1,817 Kanji characters under the applicable encoding conditions. These are theoretical maximums, not a recommendation to fill every code to its limit. Real-world readability depends on module size, print quality, camera resolution, viewing distance and surface conditions.
More data usually means more modules or a denser symbol. If a long web address is encoded directly, the code may become more complex than a short URL. A shorter, stable destination can make a smaller and more robust symbol, but URL shorteners introduce a separate trust question because the final destination is less visible before opening.
Version selection is therefore a design decision. A small label, a distant poster and a screen shown briefly in a presentation have different scanning conditions. Choose a code size and version that allow the modules to remain distinct at the expected distance and under realistic lighting. Test the actual printed or displayed output rather than relying only on a preview image.
6. What is QR code error correction?
QR Code uses Reed–Solomon error correction to recover data when some codewords cannot be read correctly. The encoder adds redundant information that allows the decoder to reconstruct damaged or obscured portions within the correction capability of the symbol. This is why a QR code can sometimes still scan after a small area has been smudged or covered.
There are four standard error-correction levels:
- L: approximately 7% restoration capability.
- M: approximately 15% restoration capability.
- Q: approximately 25% restoration capability.
- H: approximately 30% restoration capability.
These percentages are commonly described as approximate codeword restoration rates. They do not mean that a user can cover exactly 30% of the visible square area at random and expect a Level H code to work. Function patterns, the location and distribution of damage, the amount of data and the symbol's structure all matter. A logo placed in the middle of a code is not automatically safe simply because the generator selected Level H.
Increasing error correction requires additional redundant codewords. That leaves less room for the original data at a given version, and may force the encoder to choose a larger version. The result can be a denser symbol if the physical print size is unchanged. There is a trade-off between resilience and data capacity.
Choose the correction level for the environment. A clean indoor display may not need the highest level. A product label exposed to handling, dirt or abrasion may benefit from more redundancy, but the designer must still provide adequate print quality and a suitable physical size. Error correction is not a substitute for a clear quiet zone, good contrast or testing.
7. Why does a QR code have a pattern of squares rather than one long barcode?
A matrix layout stores data in two dimensions, so a symbol can be compact when the available label area is square or when the code must be scanned from multiple directions. The finder patterns make orientation detection practical. The timing and alignment structures help the decoder estimate the grid even when the camera sees perspective distortion.
The design also supports different types of data and error correction. The encoder can select a mode suited to the content, choose a version suited to the amount of data and choose a mask that produces a pattern that is easier to decode. These features are part of a defined symbology, which is why compliant readers can decode QR codes created by different software vendors.
Not every two-dimensional barcode is a QR code. Data Matrix, Aztec and PDF417 are other 2D symbologies with different structures and use cases. They may look similar to a casual observer because they all encode information in more than one dimension, but their patterns and decoding rules are not interchangeable.
8. How does a phone camera scan a QR code?
Modern phone cameras can detect QR patterns in a live camera preview. The scanner looks for the finder patterns, estimates the symbol's boundary and orientation, and maps the image back to a regular square grid. It compensates for rotation and perspective, samples the dark and light modules, reads format information and applies the appropriate decoding and error-correction steps.
The process can be understood as a pipeline:
- Image capture: the camera captures the code under available lighting.
- Detection: software searches for the characteristic finder patterns and estimates the symbol boundary.
- Geometric correction: the image is transformed to account for rotation, skew and perspective.
- Grid sampling: the reader estimates the centre of each module and determines whether it is dark or light.
- Format interpretation: the reader obtains the error-correction and mask information.
- Unmasking and codeword recovery: it reverses the mask, extracts codewords and applies error correction.
- Payload decoding: it interprets the data mode, character count and content.
- Action proposal: the phone may show a URL, contact, Wi-Fi network or other action for the user to review.
Camera focus, exposure, motion blur and image resolution all affect the quality of the captured modules. A code may be perfectly valid but fail to scan when the phone is too close to focus, the print is too small or reflections obscure the pattern. Moving slightly farther away, holding the phone steady and improving the lighting can help.
Many phone cameras decode QR codes using built-in operating-system functionality. A separate scanner app is not always necessary. The user should still review the decoded content before acting, particularly when the code opens a website or requests sensitive information.
9. Why won't my QR code scan?
Scanning problems often come from the physical symbol or the conditions in which it is presented rather than from a defect in the QR standard. Common causes include:
- Too small: modules blur together at the camera's resolution or scanning distance.
- Low contrast: pale colours, reflective ink or a dark background reduce separation between modules.
- Missing quiet zone: nearby text, borders or graphics interfere with detection.
- Distortion: stretching, wrapping around a tight curve or printing at an angle changes the module geometry.
- Damage: scratches, folds, smudges or missing sections exceed what error correction can recover.
- Glare and reflections: glossy surfaces can create bright patches that hide modules.
- Incorrect image handling: resizing, compression or screenshot scaling can soften module edges.
- Excessive data: a long payload creates a dense symbol that is difficult to print or scan at a small size.
For a code you are creating, use a reliable generator, preserve the square aspect ratio and quiet zone, and avoid unnecessary decoration. For a printed code, test a physical sample using multiple ordinary phones, at the intended distance and under the lighting likely to be used. For a code on a curved package, test it on the actual package rather than only on a flat screen.
If a code has been printed incorrectly, regenerating it from the original payload is usually safer than trying to edit individual squares. Never alter the data modules manually unless you understand the specification and can validate the final symbol with independent decoders.
10. QR code vs NFC: what is the difference?
QR codes are optical: a camera or scanner must see the printed or displayed pattern. NFC uses short-range radio communication between a reader and a compatible tag or device. A QR code can be printed on paper, displayed on a screen or attached to packaging. An NFC tag is an electronic component that stores data and responds when brought within the reader's field.
QR codes are inexpensive to reproduce and can be scanned by many cameras without specialised radio hardware. NFC can be more convenient when a user simply taps a phone, and tags can be embedded inside objects or labels. Both can point to online information, identify products or trigger application workflows. Neither technology automatically makes the destination trustworthy.
QR codes also have an important practical advantage for printed communication: the code can be visually inspected, photographed and read by a range of devices. NFC can be less visible and may require compatible hardware and settings. The right choice depends on cost, user experience, environment, read distance, security and whether the application needs to be visible or touch-based.
For a deeper explanation of contactless radio tags, see how NFC contactless communication works. A QR code and an NFC tag can also be placed together on a product to provide alternative ways to access information.
11. QR codes in payments, tickets and everyday services
QR codes are widely used because they can bridge a physical surface and a digital workflow. A restaurant menu can point to a web page. An event ticket can carry a unique identifier that a gate scanner checks against a ticketing system. A payment code can contain structured payment information that a compatible banking app interprets. A product label can link to instructions, authenticity information or traceability data.
The code itself is only one part of the workflow. A ticketing system still needs to verify whether a ticket is valid and unused. A payment app still needs to confirm the recipient and amount. A product information page still needs accurate content and a trustworthy domain. Scanning a code is not the same as completing a transaction or validating the underlying claim.
For payments, users should check the payee name and amount displayed inside the trusted payment application before confirming. A QR code can encode payment details that are different from what a nearby sign or person claims. Do not enter a UPI PIN or banking password merely because a QR code or website asks you to do so; follow the payment provider's official instructions and understand when authentication is required.
12. What is GS1 Digital Link and how is it related to QR codes?
GS1 Digital Link is a standard for expressing GS1 identifiers in a web URI structure. A QR code that carries a GS1 Digital Link can connect a product identifier, such as a Global Trade Item Number (GTIN), to online product information. Depending on the implementation, the URI can include additional identifiers or attributes such as batch, lot or serial information.
This approach can make a product package a gateway to information that can be updated online, such as ingredients, allergens, instructions, sustainability information or traceability details. The physical code can remain the same while the destination service changes the information it provides. That is different from printing a direct URL to a page that may later be deleted.
GS1 Digital Link does not mean every QR code is a GS1 code. Ordinary QR codes can contain almost any supported data. A GS1 implementation follows GS1 identification and URI rules and must be processed by compatible systems. Retail point-of-sale readiness also depends on scanner and software capabilities, so product owners should follow the applicable GS1 implementation guidance for their market.
QR codes and GS1 DataMatrix are also distinct 2D barcode formats. Both can carry GS1 identifiers in relevant applications, but they use different symbologies and data representations. A scanner or business process must support the format being used.
13. Can QR codes be dangerous? Understanding quishing
A QR code is not inherently safe or unsafe. It is a way of encoding data. The risk comes from what the code contains and what happens after it is scanned. A malicious code may open a fake login page, payment request or download. QR-based phishing is often called quishing.
Scammers can place a replacement sticker over a legitimate code on a parking meter, poster or public notice. They can also send a QR image in an email or message and claim that the recipient must scan it to fix an account, track a parcel or receive a refund. The code can hide a web address from someone who would have been more cautious if the link had been displayed as ordinary text.
Use these precautions:
- Preview the destination: use the phone's built-in scanner and inspect the displayed domain before opening it.
- Check for tampering: look for a sticker placed over the original code or signs that the printed surface has been altered.
- Be cautious with urgency: unexpected messages demanding immediate scanning are a warning sign.
- Use a known route: if a bank, courier or government service asks you to act, open its official app or type its known website address yourself.
- Do not share secrets: a QR destination should not persuade you to disclose passwords, OTPs, card details or UPI PINs.
- Review payment details: confirm the payee and amount in your trusted payment app before approving.
- Keep software updated: install operating-system and browser security updates and use account protections such as multifactor authentication.
Do not assume that a QR code printed on a branded object is automatically genuine. Likewise, do not assume that every unfamiliar code is malicious. Apply the same link-checking habits you would use for email, text messages and websites.
14. How to create a QR code that scans reliably
Start by deciding exactly what the code should do. If it needs to open a web page, use the final HTTPS URL and ensure the destination is maintained. If it carries a product identifier or structured payment payload, follow the relevant application standard rather than inventing a format. Avoid adding unnecessary text to the payload because more data can increase the symbol's density.
Choose an appropriate version and error-correction level through a standards-compliant generator. Preserve the quiet zone around all four sides. Use a strong contrast between dark modules and a light background. The conventional dark-on-light arrangement is generally the safest choice for broad compatibility. Avoid gradients, transparency, low-contrast colours and complex backgrounds behind the code.
Do not stretch the symbol horizontally or vertically. Keep modules square and large enough for the expected print size and viewing distance. If you place a logo in the centre, remember that it covers data modules. Higher error correction may help, but it does not guarantee success. Test the final design with multiple devices after all logos, frames and printing changes have been applied.
For printed material, make sure the surface is not highly reflective and the code is not wrapped across a fold or tight curve. For screens, display the code at a sufficient size and brightness. A code on a moving or flickering screen may be harder to scan. Include a short human-readable description or fallback URL where practical so users understand what they are being asked to open.
15. QR code privacy: what happens when you scan?
Decoding a QR code locally does not necessarily send the code's contents to a remote server. A camera app may interpret the data on the device and show a suggested action. If the user opens a URL, the browser then makes a network request to the destination. That website may receive ordinary connection information such as the IP address, browser details and requested page, subject to the browser and site's behaviour.
Some QR campaigns use redirect services or analytics parameters to measure visits. A URL may include campaign identifiers or a unique token. In a ticketing or authentication workflow, a unique code can identify a specific person or transaction. Treat QR codes on tickets, receipts and personal documents as you would treat the underlying information: avoid posting images publicly if they contain unique identifiers that could be reused.
Businesses should explain what information is collected after scanning, avoid embedding unnecessary personal data directly in a code, use secure HTTPS destinations and protect any associated backend system. A QR code is not encryption. Anyone who can photograph or decode a visible code may be able to read its contents.
16. QR codes and the future of product information
Retailers and manufacturers are exploring richer 2D barcodes that can support checkout as well as consumer-facing information. A product code may help identify the item while a linked service provides details that change over time. This can support product traceability, recall information, usage instructions and regulatory disclosures.
These developments do not remove the need for reliable identifiers, accurate databases, scanner compatibility and clear governance. A code can only be useful if it is printed correctly, decoded by the equipment in use and linked to maintained information. Companies also need a plan for what happens if a product page, resolver or domain changes over the product's lifetime.
For consumers, the key habit remains simple: treat a QR code as a link or data carrier, not as a trust badge. Check the destination and the action requested. For organisations, design for readability, maintain the destination and test the complete workflow from the printed code to the system that processes it.
Frequently asked questions about QR codes
1. What does QR stand for?
QR stands for Quick Response. DENSO WAVE developed the QR Code in 1994 as a two-dimensional barcode that could be read quickly and store more information than a conventional one-dimensional barcode in a compact symbol.
2. How does a QR code store information?
A QR encoder converts data into bits and codewords, adds error-correction information, and places the resulting pattern into a grid of dark and light modules. Finder, timing and alignment patterns help a scanner locate and decode the symbol.
3. Does scanning a QR code require internet access?
No. The code can be decoded without an internet connection. Internet access is needed only if the decoded information requires an online action, such as opening a website or retrieving product information from a server.
4. What are the four QR code error-correction levels?
The levels are L, M, Q and H, with approximate restoration capabilities of 7%, 15%, 25% and 30% of codewords respectively. Higher correction adds redundancy and reduces the amount of data that fits in a given version.
5. Can a QR code work if part of it is damaged?
It can, within the limits of its error-correction capability. The result depends on how much information is damaged, where the damage occurs, the correction level and whether important function patterns remain readable. There is no guaranteed safe damaged-area percentage.
6. What is the difference between a QR code and a barcode?
A traditional one-dimensional barcode encodes information in bars and spaces along one axis. A QR code is a two-dimensional matrix barcode that stores data in a grid of modules and includes patterns that help scanners locate and orient it.
7. Why is my QR code not scanning?
Common causes include a code that is too small, poor contrast, glare, a missing quiet zone, distortion, damage, camera focus problems or too much encoded data for the available print size. Test the final code on multiple devices and at the intended distance.
8. Are QR codes safe to scan?
QR codes are not inherently safe or unsafe. They can contain legitimate or malicious destinations. Preview the URL, check for tampering, avoid unexpected urgent requests and never enter passwords, OTPs or payment secrets on an untrusted page.
9. What is GS1 Digital Link QR code?
It is a QR code that encodes a URI structured around GS1 identifiers, such as a product's GTIN. It can connect a physical product to online information and may support additional data such as batch, lot or serial details, depending on the implementation.
10. Can I put a logo in the middle of a QR code?
A logo can cover data modules and reduce readability. Higher error correction may help but cannot guarantee that the code will scan. Keep the logo small, preserve the quiet zone and test the finished design with different phones and scanners.
Sources & further reading
- DENSO WAVE — What is a QR Code?
- DENSO WAVE — QR Code versions and information capacity
- DENSO WAVE — Error correction feature and Reed–Solomon codes
- DENSO WAVE — QR Code standardisation
- ISO — ISO/IEC 18004:2024 QR Code symbology specification
- GS1 — 2D Barcodes at Retail Point-of-Sale Implementation Guideline
- GS1 — QR phishing and consumer safety
- US Federal Trade Commission — QR-code phishing guidance
- UK National Cyber Security Centre — QR Codes: What's the real risk?
