How Does a QR Code Work? The Science Behind Every UPI Payment

There was a time when paying for a Rs 20 ice cream meant checking your wallet for change. A Rs 35 packet of vegetables could leave you counting coins in your palm. And if the exact amount wasn’t there, someone had to make a quick trip to a nearby shop for change.

Today, the same ice cream vendor may simply point to a small black-and-white square stuck beside the cart.

So does the neighbourhood vegetable seller

So does the chai stall, the local kirana shop and the roadside momo vendor.

You raise your phone, scan that square, enter your UPI PIN and within seconds, the money is transferred.

But what exactly happens between pointing your camera at those tiny black-and-white boxes and seeing that satisfying “Payment successful” message?

That square is more than a picture

What looks like a random collection of black and white boxes is actually a carefully structured way of storing information.

A QR code, short for Quick Response code, was invented in Japan in 1994 by engineer Masahiro Hara, originally to track car parts in factories. Unlike a traditional barcode, which stores information along a single horizontal line, a QR code stores information across a two-dimensional grid.

Those little black and white squares are called modules. Depending on how much information is being stored, QR codes can have different versions, ranging from 21 × 21 modules to 177 × 177. More information generally means more modules.

For a UPI payment, the encoded information can include the merchant’s UPI ID or virtual payment address, merchant name, transaction reference and, depending on the QR type, the amount to be paid.

So the QR code is not a picture of the shopkeeper or their bank account. It is a compact, machine-readable package of payment instructions.

First, your phone has to find the code

Ever noticed the three large squares sitting in the........

© The Better India