QR code

It was invented to track car parts in a Japanese factory, and its maker gave the patents away for free. Now those little squares are everywhere you look.

3 min read · 8 key facts · 6 terms decoded

Illustration for QR code

Born on a Factory Floor

The little square that now sits on menus, tickets, and posters was invented in 1994 by Masahiro Hara of the Japanese company Denso Wave, and its original job was gloriously boring: labelling automobile parts.

The design has a playful origin. Hara drew inspiration from the black and white patterns of a Go board, and the distinctive squares in the corners were chosen after a hunt for the black-and-white ratio least likely to appear in ordinary printed matter, a sequence of 1:1:3:1:1.

Then came the masterstroke that made the QR code universal: Denso Wave chose not to enforce its key patents, waiving its rights for standardized codes to encourage adoption by anyone, anywhere. The name "QR Code" itself, short for quick-response code, remains a registered trademark, but the technology was effectively a gift to the world.

Why a Torn Code Still Scans

A QR code is a two-dimensional matrix barcode, and its real superpower is resilience. Thanks to Reed-Solomon error correction, a scanner can recover the full message even when up to 30 percent of the code is damaged, scratched, or covered.

The three large squares in the corners are fiducial markers. They let a camera instantly work out which way the code is oriented, so you can scan it upside down or at an angle and it simply does not care. The data itself is read from patterns running in both the horizontal and vertical directions.

Capacity is remarkable for something so small. Using its four encoding modes, numeric, alphanumeric, byte, and kanji, a maximum-size code can hold up to 7,089 digits or 2,953 bytes. At the other extreme, tiny Micro QR codes as small as 11 by 11 modules store just 35 numeric characters, and a rectangular variant was standardized in 2022.

From Car Parts to Everything

For years the QR code stayed close to its industrial roots, tracking products, identifying items, and managing documents. Then phones learned to read them, and the squares escaped the factory.

China turned them into money. Alipay designed QR-based payment methods in 2011, and by 2018 roughly 83 percent of payments there were being made via QR code. Japan uses them for football and baseball tickets, and by June 2011, 14 million American mobile users were already scanning them.

The pandemic finished the job. As restaurants replaced physical menus with "touchless" alternatives, by September 2020 nearly one in five consumers in the US and UK had noticed the surge. In 2022, 89 million Americans scanned a QR code, up 26 percent from 2020. The code invented for car parts had become part of daily life.

The Dark Side of the Squares

A QR code has one built-in weakness: humans cannot read it. You never really know where a code will take you until you scan it, and criminals have noticed.

Malicious codes can point a phone's browser at an exploit, quietly enable the camera, microphone, or GPS, or trigger actions like sending premium text messages. One Russian scam charged victims 6 dollars per premium text sent automatically after a scan.

There is even a word for the physical attack: attagging, the practice of pasting a fraudulent code on top of a legitimate one on a poster or sign. The genuine advertisement stays visible, the destination changes, and the victim trusts the brand while the code serves the crook. The same openness that made QR codes universal also makes them a perfect disguise.

Key terms, decoded

attagging
The trick of sticking a malicious QR code on top of a legitimate one so victims scan the attacker's code by mistake.
fiducial marker
A fixed reference shape placed in an image so a camera can work out position and orientation.
kanji
The Japanese writing system based on Chinese characters. QR codes have a special mode for storing it efficiently.
matrix barcode
A barcode that stores information in two dimensions, both across and down, instead of in a single row of stripes.
Reed-Solomon error correction
A mathematical technique that adds backup information to data so the original can be rebuilt even when part of it is lost or damaged.
trademark
A legally protected name or symbol that identifies a product and may not be used commercially by others without permission.

This Quicky is an original summary based on the Wikipedia article “QR code”, available under the CC BY-SA 4.0 license.