All About QR-Code (Quick Response Code)

Let’s dive into the depths of QR-Code and learn how it works.

Naman Mehrotra
4 min readJun 13, 2020
Photo by Proxyclick Visitor Management System on Unsplash

QR-Code is a backbone for many sectors. Though it was invented a century ago, it is widely used these days as a unique identification of an entity.

QR Codes have already grabbed the payment markets where the leading payment merchants such as Paytm, Google Pay or Phone Pe are widely using it to promote One Tap Payment and now QR Code is paving its way down to Delivery and Transportation sector too.

With its capabilities of storing up to 350x more information than a regular barcode, it is leaving its predecessor far behind now.

Let’s get started and look more into how it works

A QR code consists of black squares arranged in a square grid on a white background, which can be read by an imaging device such as a camera and processed using CPU power. The required data is then extracted from patterns that are present in both horizontal and vertical components of the image.

They’re called two-dimensional (2D) barcodes and, just like ordinary barcodes, they’re machine-readable so they can quickly pass on information about a product in the blink of an electronic eye. Where a barcode presents a string of information as a one-dimensional line of black and white bars, a 2D barcode packs a lot more information into a grid of black and white, square-shaped dots.

Advantages of the QR Code:

More information:

A 2D barcode is a square of information running in two directions so it can efficiently pack more information into the same space.

Fewer errors:

Barcodes hold so little information that there is very little redundancy.

But the higher capacity of 2D barcodes means they can hold the same information in different ways with sophisticated, built-in error checking systems. If a code is damaged, that’s easy to detect — and it may still be possible to read some or all of the code.

Easier to read:

The large square boxes at the edges of QR-Code help in alignment and it provides 180 degrees reading capabilities.

By their very nature, QR codes (and other data matrix codes) are meant to be read by machines, not humans, so there’s only a certain amount we can tell just by looking at them. Although each code is different, they contain a few interesting, common features.

  1. Quiet zone: An empty white border that makes it possible to isolate the code from among other printed information (for example, on a dirty envelope, among the black and white print of a newspaper, or on smudged product packaging).
  2. Finder patterns: Large black and white squares in three of the corners make it easy to confirm that this is a QR code (and not, say, an Aztec code). Since there are only three of them, it’s immediately obvious which way up the code is and which angle it’s pointing at (unless the code is partly obscured or damaged in some way).
  3. Alignment pattern: This ensures the code can be deciphered even if it’s distorted (viewed at an angle, printed on a curved surface, and so on).
  4. Timing pattern: This runs horizontally and vertically between the three finder patterns and consists of alternate black and white squares. The timing pattern makes it easy to identify the individual data cells within a QR code and is especially useful when the code is damaged or distorted.
  5. Version information: There are various versions of the QR code standard; the version information (positioned near two of the finder patterns) simply identifies which one is being used in a particular code.
  6. Data cells: Each individual black or white square that’s not part of one of the standard features (the timing, alignment, and other patterns) contains some of the actual data in the code.
Source: YouTube

Data Masking is a way of choosing the best possible arrangement of modules. This makes it easy for scanners to decode the QR Code. The processor locates the three distinctive squares at the corners of the QR code image, using a smaller square (or multiple squares) near the fourth corner to normalize the image for size, orientation, and angle of viewing. The small dots throughout the QR code are then converted to binary numbers and validated with an error-correcting algorithm.

Source: Wikipedia

A scanning application on a smartphone simply captures and decodes this binary information to useful data.

It scans the QR code from the bottom right up to top left.

--

--