How do QR codes work?

2022.03.30

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

QR codes have become a part of our daily lives, as consumers we generally use them to make payments and in the current pandemic effected world, many restaurants have shifted to serving their menu via QR codes, scanning which lead users to a link where the menu can be viewed but they can do a lot more than that.

QR code stands for Quick Response code. In the current day and age, QR codes are very popular and are being used daily by consumers. QR code was developed by a Japanese company Denso Wave which is a components manufacturing company in 1994 due to the need for a faster way of keeping track of components  and manufacturing along with higher amount of data representation compared to barcodes in the automobile manufacturing industry. 

QR Codes are 2D barcodes which use black square boxes on a white background to relay information. They have been inspired from the pieces of the popular game GO. They were designed to overcome the limitations of barcodes, which are mainly.

Limitations of barcodes

  • Barcodes can only represent up to 20 alphanumeric characters of data, any data which is longer than that cannot be represented by barcodes.
  • Barcodes are read by a high intensity light being cast on the barcode and the reflection of the light is used to decode the barcode, the white (blank) portions of the code reflect back the light and the dark stripes absorb the light. This means that we need specialised scanners to understand barcodes.

How do QR codes overcome these limitations?

QR codes being 2D versions of barcodes, they can represent 350 times more information than a barcode does. This can increase depending on the DPI of the barcode, the higher the DPI, higher is the information represented by the QR code. Which enables them to store URLs, product information etc. QR codes are easy to read, they can be read by phone cameras, which remove the need of usage of a specialised device to understand this code.

QR codes also have in-built error correction, which makes them readable even in low light scenarios, as well as when the code itself is damaged, partially visible or not in its best condition. Scan the code,  it will be a successful scan even though there are overlaying circles present on the code.

How do they work?

QR Code with highlighted permanent boxes.

QR codes are made of small solid black squares on a blank background, each square represents a bit and together the whole code represents a link or information of any other kind.

There are 3 black boxes on all QR codes, these boxes are much larger in size than the rest of the boxes present on the code. They are places one on each top corner and one on the bottom left corner. This provides the orientation of the code as well as relays the information to code scanners that the code which they are reading is a barcode. One can compare them with the start and end markings of a barcode.

Limitations of QR code

There are 2 sides of every coin, with this coin, the dark side is small, but more complex to resolve and much more harmful if taken advantage of. QR codes can represent a lot of information and users do not know which ones represent what information till they are scanned, which has led to hackers using them widely to spread links of websites where users can be easily phished or to webpages from which malware or trojan horses are distributed.

QR codes are highly reliant on strong internet connection, which makes them limited to areas with good internet connection and difficult to use in rural areas.

Bonus

Try scanning QR codes on this webpage ;-).