Category: 2D Symbologies
QR codes are a type of barcode used in retail, logistics, consumer advertising, and airline ticketing applications. They can store a lot of information in a small physical space—from product information to a website URL—and have robust error correction capabilities that maintain readability even if part of the barcode is obscured or damaged.
This guide provides software developers with the information they need to build applications that create or decode QR codes.
What is a QR code?
A QR code (“Quick response” code) is a two-dimensional barcode that stores a large volume of data in a small physical space. It encodes data in a square grid of dark and light boxes and can be read from any orientation (left, right, top, or bottom).
QR codes are a graphical representation of machine-readable data, known as a data carrier. The data inside the carrier is known as the data structure, encoded in different formats, and it determines how to parse the payload after decoding. QR codes support alphanumeric, numeric, 8-bit binary, and kanji character sets.
QR codes were invented in 1994 by Masahiro Hara of DENSO Wave to track parts used for automobile production. There have been several updates to the QR code standard since then. This guide focuses on the widely deployed “Model 2” QR Code standardized in ISO/IEC 18004:2024.

Try the Scandit Barcode Scanner SDK
Evaluate our QR code decoding with a 30-day free trial
How a QR code works
A QR code contains these components:
- Finder patterns: Three large squares located at the top-left, top-right, and bottom-left corners to establish the position and orientation of the symbol.
- Timing pattern: Dotted lines between the finder patterns to help scanners determine the structure and orientation of the symbol’s data modules.
- Alignment pattern: Small squares that scanners use to correct image distortion.
- Format information: Strips of squares that contain details about the error correction level and the masking pattern used in the code.
- Version information: Blocks that define the symbol’s dimensions and capabilities, used only for QR code versions 7 and above.
- Data modules: The grid of black and white squares where the symbol’s information is stored.
- Quiet zone: The border around the code that separates it from the background.
What are the QR code versions?
QR code versions range from 1 to 40, each with a different number of data modules that determine its data capacity and physical size.
The number of modules increases by four on each side for every version increase. Version 1 has 21x21 modules, and version 40 has 177x177 modules.
What are the QR code types?
QR code types are categorized by data capacity, physical characteristics, and features. The following table explains the differences between them:
QR code type | Physical characteristics | Maximum data capacity (numeric characters) |
---|---|---|
QR Code Model 1 | The original QR Code, defined by a square grid with prominent finder patterns. | 1,167 |
QR Code Model 2 | Similar to Model 1, with an added alignment pattern to help scanners read smoothly, even if the symbol is distorted. | 7,089 |
Contains only one position detection pattern and has a smaller quiet zone, making smaller symbol sizes possible. | 35 | |
Uses a rectangular shape, making it easy to apply to narrow spaces. | 361 | |
Secret Function Equipped QR Code (SQRC) | Similar to Model 1/Model 2, but data is split between public and encrypted areas to improve security. | 7,089 |
FrameQR | Similar to Model 1/Model 2, but includes a canvas area to insert images. Defined by DENSO Wave’s proprietrary technology, not an open standard like ISO. | 7,089 |
iQR Code | Similar to Model 2 and supporting both square and rectangular shapes. Defined by DENSO Wave’s proprietrary technology, not an open standard like ISO. | 40,000 |
What is the difference between static and dynamic QR codes?
The data encoded into static QR codes can’t be changed after they’re created, while dynamic QR codes allow businesses to change the scan destination even after the codes have been created and printed.
Static QR Codes
Once printed or distributed, the data encoded into a static QR code is permanent. If the target URL or content changes, a new code must be created. Static codes are often used for fixed references like serial numbers, Wi-Fi credentials, or one-time marketing campaigns.
Dynamic QR Codes
A dynamic QR Code encodes a short URL that resolves to a redirect service. When a user scans the code, the scanner resolves the short URL and redirects to the current destination. This indirection enables two capabilities:
- Editability: The landing page or function behind the QR Code can be updated without reprinting the symbol, making them useful for long-running campaigns or asset management.
- Analytics: As every scan passes through a redirect service, users can capture scan statistics such as count, timestamp, geolocation, and device operating system. These metrics help measure engagement or monitor usage.
How much data can a QR code store?
The data capacity of a QR code is related to its version. Each has a maximum capacity according to the amount of data, character type, and error correction level used.
The following table, adapted from the DENSO Wave QR code site, shows the storage sizes for select Model 2 versions at the lowest error correction level (L, with an approximate 7% data restoration rate):
Version | Maximum characters (alphanumeric) | Maximum characters (numeric) | Maximum characters (8-bit binary) | Maximum characters (kanji) | Module size |
---|---|---|---|---|---|
1 | 25 | 41 | 17 | 10 | 21x21 |
20 | 1,249 | 2,061 | 858 | 528 | 97x97 |
30 | 2,520 | 4,158 | 1,732 | 1,066 | 137x137 |
40 | 4,296 | 7,089 | 2,953 | 1,817 | 177x177 |
How is data encoded in a QR code symbol?
QR codes support four encoding schemes:
- Alphanumeric: decimal digits 0 through 9, uppercase letters, the symbols $, %, *, +, -, ., /, and :, and the space character.
- Numeric: decimal digits 0 through 9.
- 8-bit binary: characters from the ISO-8859-1 character set.
- Kanji: double-byte characters from the Shift JIS character set.
It is possible to use multiple encoding schemes within the same QR code by setting the mode flag before each data section encoded by that scheme.
QR codes also include different features, known as modes, that are set during encoding:
- Extended Channel Interpretation (ECI): allows users to encode data using international Unicode character sets other than the ISO-8859-1 default.
- Structured Append: allows data to be split into a maximum of 16 separate but logically linked QR code symbols.
- FNC1: allows the QR code to function as a GS1 barcode defined by the GS1 Digital Link standard. The retail, warehousing, and supply chain industries commonly use this to encode URLs.
GS1 encoding has to be enabled when generating a QR code, and it’s the responsibility of the barcode reader to identify and decode GS1 data.

Here is an example of a GS1 QR code and its corresponding symbol:
JQ3013456789012345611210714
- JQ3: FNC1
- 01 34567890123456: GTIN Application Identifier and data
- 11 210714: Production date Application Identifier and data
QR code error correction
QR codes use the Reed-Solomon error correction method. This approach converts the original data into a polynomial to define a unique set of points, which are then embedded into the symbol. The result is a symbol that contains the original data plus a polynomial expression that scanners can use to rebuild the QR code.
There are four levels of error correction in a QR code:
- L: 7% of data can be restored.
- M: 15% of data can be restored.
- Q: 25% of data can be restored.
- H: 30% of data can be restored.
Higher levels of error correction require more data capacity and physical size.
Where is a QR code used?
QR codes are versatile data carriers that many industries have adopted because they’re fast to scan, adaptable to distortion, and can carry either structured or free-form payloads.
Application examples include:
- Manufacturing: Printed on parts, packaging, or equipment to encode product IDs, serial numbers, or batch and lot information.
- Ticketing: Used for event tickets, boarding passes, or access control credentials that can be quickly validated at entry points.
- Marketing: Placed in print ads, signage, business cards, or product packaging to connect users directly to landing pages, promotions, or app downloads.
- Logistics: Affixed to cartons, pallets, or shipping labels to streamline tracking, improve traceability, and link shipments to supply chain systems.
What makes the QR code unique?
The biggest advantage of QR codes is their balance of data capacity, scan robustness, and feature flexibility. They’re easy to capture at distance or skewed angles, encode diverse data types in a compact format, and are widely recognized by consumer devices.
Key benefits of QR codes vs. other barcode types
- Readable from any direction, allowing users to scan items at different orientations relative to their device.
- Compared to 1D barcodes, QR codes can store more data (thousands of characters vs. a dozen digits) and are still scannable even if part of the code is damaged, due to built-in error correction. Their square format is also more space-efficient, reducing label footprint while supporting variable-length data.
- Compared to Data Matrix codes, QR codes have stronger finder patterns (three large corner squares) and alignment features, which improve scan robustness when symbols are distorted or captured from long distances. They also support multi-byte character sets, such as kanji, which Data Matrix does not natively support. The tradeoff is that a QR code requires more physical space to store the same amount of data.
- Error correction flexibility: QR codes allow selection of four error correction levels (L, M, Q, H), enabling users to trade off data capacity and resilience.
- Standards compliance: QR Codes are supported by GS1 for supply chain and retail applications, with FNC1 and Application Identifiers enabling structured trade item data.
How to create a QR code
Creating a QR code is a process of encoding information into the matrix of dark and light modules defined by the QR code standard. At a high level, this involves deciding what data you want to encode, choosing the right encoding scheme for your industry and use case, applying error correction coding, and rendering the graphical symbol with proper quiet zones so it can be scanned reliably.
There are several ways to create a QR code. These include free online generators, using an existing library such as qrcode for Python, and building your own generator.
How to scan a QR code
QR codes are scanned with camera-based mobile devices running software designed to decode the symbology.
Scandit’s barcode scanning software supports QR codes and over 35 other symbologies, including these features:
- Accelerated identification and decoding of QR codes under poor environmental conditions, long distances, and non-linear distortions.
- Simultaneous data extraction from multiple QR codes within the field of view, with MatrixScan.
- Support for GS1 QR codes and a GS1 Parser API to translate data components into usable formats.
How to decode a QR code
If you’re building your own decoding method for QR codes, the general steps are as follows.
Pre-requisites
The image of the QR code is captured and stored with a resolution high enough to distinguish its components.
Decoding steps
- Convert the image into a binary representation using thresholding, where pixels are set to a maximum or minimum value (usually 255 for white and 0 for black) based on whether the corresponding image segment is above or below a given threshold value.
- Identify the captured image's finder pattern and quiet zone to distinguish the QR code symbol from the background.
- Estimate any perspective distortion by examining the alignment pattern.
- Determine the encoding mode (alphanumeric, numeric, 8-bit binary, kanji, ECI) by examining the format information.
- Read the bits from the data grid, which is read from the bottom right to the bottom left, following a back-and-forth path through each column.
- Decode symbols from the bits and apply the error correction method (Reed-Solomon).
- Translate the data stream using an encoding scheme understood by your app. If the QR code’s scheme is unknown, you have two options:
- Send the raw data to the app.
- Convert the data into a format the application uses, for example, UTF-8.
- Send the results to the application for further processing or display.
The Scandit Barcode Scanner SDK implements this process for you and provides additional features for real-world QR code use cases.
Adding QR code scanning to your app only requires two steps after setting up the Scandit software. The following instructions are based on the "Barcode Capture Simple Sample" application for the Scandit JavaScript Barcode Scanner SDK:
1. Enable the required symbologies, including QR codes
settings.enableSymbologies([
Symbology.QR,
Symbology.DataMatrix,
Symbology.UPCE,
]);
2. After a barcode is decoded and recognized by the Scandit library, retrieve its data by implementing the Scandit listener interface
barcodeCapture.addListener({
didScan: async (barcodeCaptureMode: BarcodeCapture, session: BarcodeCaptureSession) => {
// Disable the mode to avoid unwanted scan until the user closes the displayed result.
await barcodeCapture.setEnabled(false);
// Hide the viewfinder.
await barcodeCaptureOverlay.setViewfinder(null);
const barcode: Barcode | null = session.newlyRecognizedBarcode;
if (!barcode) {
return;
}
const symbology: SymbologyDescription = new SymbologyDescription(barcode.symbology);
showResult(`Scanned: ${barcode.data ?? ""}\n(${symbology.readableName})`);
},
});
Here, the method extracts:
barcode.symbology
- barcode symbology as an enumeration.barcode.data
- barcode data as a UTF-8 string.symbology.readableName
- human-readable name of the symbology.
How Scandit supports QR codes
The Scandit Barcode Scanner SDK meets the needs of real-world developers, including these features specific to QR codes:
- Explicit GS1 QR code support with FNC1 handling and AI parsing.
- Normalization of all encoding schemes to UTF-8, if the data is convertible, or access to the raw data.
- A GS1 Parser API to normalize and extract element strings into a human-readable format without worrying about encoding or delimiters. This includes tuning options, such as strict adherence to the GS1 standard and overriding the length of the Application Identifier string.
- Enabling and disabling of supported symbologies, including industry presets, to improve scanning performance.
- Structured append support to extract data from multiple symbols. Using MatrixScan, this returns data from multiple labels in the camera’s field of view at once.
Scandit’s software supports all major operating systems, programming languages, and frameworks, including Native iOS, Native Android, JavaScript, Cordova, Xamarin and Xamarin.Forms, .NET (iOS, Android, and MAUI), React Native, Flutter, Capacitor, Titanium, IBM MobileFirst, SAP Fiori, and Oracle Xstore.
“We evaluated the reading accuracy of Scandit. Barcodes attached to fruits and vegetables are not always flat and can be curved. Scandit can accurately read such barcodes. During the review stage, we compared other scanning engines, but Scandit was overwhelmingly superior in terms of reading accuracy.”
Try the Scandit Barcode Scanner SDK
Evaluate our QR code decoding with a 30-day free trial
FAQs
What can a QR code do?
QR codes are commonly used to market goods and services and share information, such as product details, loyalty programs, website links, and contact information. They are a low-cost and straightforward way to create omnichannel experiences that connect physical goods (in a retail store, for example) with digital experiences and systems.
They are also increasingly being used for payment transactions and authentication purposes, such as contact tracing or ticket verification.
How can you read a QR code?
QR codes can be read using almost any smart device with a camera (such as your smartphone). The Scandit Barcode Scanner SDK supports scanning QR codes in various environments and use cases, and can be deployed on all major operating systems, programming languages, and frameworks. Support includes Native iOS, Native Android, JavaScript, Cordova, Xamarin and Xamarin.Forms, .NET (iOS, Android, and MAUI), React Native, Flutter, Capacitor, Titanium, IBM MobileFirst, SAP Fiori, and Oracle Xstore.
What is the difference between a QR code and a Data Matrix code?
QR codes have a finder pattern consisting of three square structures placed at the top right, top left, and bottom left corners, while Data Matrix barcodes have an L-shape as their finder pattern.
Both QR codes and Data Matrix barcodes are two-dimensional barcodes. However, QR codes are larger and can contain more data than Data Matrix codes. QR codes also support multi-byte character sets like kanji, while Data Matrix can only encode information from numeric and alphanumeric characters.
Data Matrix codes are physically smaller than QR codes, offering higher data density at a very small size. This makes Data Matrix ideal for smaller spaces, such as grocery labels and electronic components.
When were QR codes invented?
QR Codes were invented in 1994 by Masahiro Hara and a team at Denso Wave, then a division of Denso Corporation (a Toyota subsidiary). They were developed to streamline tracking of automotive parts during assembly, to replace multiple 1D barcode labels with a single, high-capacity symbol that could be read quickly.
Are QR codes replacing UPC codes?
GS1 states that EAN/UPC barcodes are not going away and will co-exist with QR codes as long as use cases exist.
The GS1 Sunrise 2027 initiative aims to minimize using UPC/EAN barcodes to leverage the greater data storage capabilities of QR codes. The first phase will see QR/Data Matrix codes and traditional barcodes printed on packaging. After 2027, manufacturers will have the option to replace traditional barcodes entirely.
What is the best QR code reader?
The best QR code reader scans symbols quickly and accurately without user intervention, and supports the application's required data formats. It can handle a variety of workflows and environmental conditions, such as low light and damaged labels, without slowing down business processes.
The Scandit Barcode Scanner SDK leads the industry in scanning performance and can capture QR code data under heavily degraded conditions (low light, long distances, awkward angles, torn and partially obscured labels). Scandit is used by over 2,100 customers globally. The software is designed to meet the needs of enterprise developers who need rapid integration with their development stack and robust support from prototyping to production.