You have seen black & white square-shaped barcodes on magazine ads or business cards. These are QR Codes. They do the job of connecting you from print media to useful online content. But have you ever wondered how QR Codes work? How is a QR Code scanner able to read it?
After reading this guide, you will become an expert on how QR Codes work.
How QR Codes work
Think of QR Code as a language. Humans can’t read this language but mobile devices and scanners can.
Just as the English language has rules on how to form a sentence, a QR Code is also made up of elements.
The illustration below depicts the basic structure of a QR Code and its elements:
QR Codes are made up of data modules
A Module is the fundamental unit of a QR Code. They are the black-and-white blocks that make up the data encoded in a QR Code.
Modules store data and make up the rows and columns of the QR Code (called the Data Matrix). Positioning of data bits begins from the bottom right corner of the matrix. It moves upward in a two-module wide column and switches direction on reaching the top.
Number of rows and columns of modules are determined by the Version Number
A QR Code has equal number of rows and columns of modules (square-shaped). But QR Codes cannot have any number of rows (or columns). The number depends on the Version Number of the QR Code. For example:
- Version 1 have 21 rows and 21 columns of modules
- Version 2 have 25 rows and 25 columns, and so on
- Version Number ranges between 1 and 40.
Higher the version number, higher the number of rows and columns. Thus, higher is the storage capacity.
Data can be encoded in four character modes
It is possible to encode data in a QR Code in four modes – numeric, alphanumeric, binary, and Kanji. Storage capacity differs depending upon version number and encoding mode.
Size of module is determined by Timing Pattern
The sixth row and column make up the Timing Pattern. These are alternating black-and-white modules. These enable the scanning software to understand the width of a single module.
Scanner identifies the QR Codes via Finder Patterns
Unlike barcodes, QR Code have Finder Patterns (also called Position Markers or Eyes). These take up three corners of the code. Their function is to help scanners find the edges of QR Code.
Finder Patterns and data are distinguished by a Separator
Separator helps the scanner distinguish between Finder Patterns and the actual data.
A QR Code needs a Quiet Zone to be identified
A QR Code must have white space (equal to 4 modules thick) called a Quiet Zone around the boundary of the QR Code.
It helps the scanner to locate the Finder Patterns.
Orientation of the QR Code is determined by Alignment Markers
The Alignment Markers help the scanner determine the orientation of the QR Code. This makes it possible to scan a QR Code at any angle.
Format Information is also required to decode the QR Code
Format information contains two pieces of data – Level of Error Correction and Mask Pattern.
Error Correction allows wear & tear
A QR Code has the capability to remain scannable even if it is somewhat damaged – upto 30%. This is possible due to an algorithm called Reed-Solomon Error Correction. CDs and DVDs also use this algorithm to remain readable despite scratches, wear & tear, etc.
Note that adding Error Correction increases the number of modules (data blocks) in a QR Code. Hence, it is possible to adjust the level of Error Correction as per requirements.
There are four possible levels of error correction:
- Low (L) – 7%
- Medium (M) – 15%
- Quartile (Q) – 25%
- High (H) – 30%
You may have noticed that some QR Codes have images in them as part of their design. This is possible because designers add the image as error.
The custom QR Code, created using Scanova, will still remain scannable and functional.
Mask Patterns make QR Codes more readable for the scanners
Masking is inverting of the colors of the modules. Dark modules convert to white and white ones to dark.
Data Masking is a way of choosing the best possible arrangement of modules. This makes it easy for scanners to decode the QR Code.
There are eight Mask Pattern possibilities. For example:
- Mask every even-numbered row for Mask Pattern 1
- Mask every third column for Mask Pattern 2
Here is how to choose the right masking pattern:
- Apply all eight mask patterns to the QR Code
- Calculate Penalty Score for each resulting QR Code
- Choose the arrangement with the least Penalty Score
That’s all you need to know. You are now an expert on how QR Codes work. Get started by creating your first QR Code.
Create your first QR Code now
Still have a question about how QR Codes work? Ask in the comments below.