Curious Mundi
Everyday Tech

How Do QR Codes Work, and Who Invented Them? (It Started in a Car Parts Company)

A QR code stores information in a grid of light and dark squares, uses three corner markers so it can be read from any angle and survives damage thanks to error correction. It was born in 1994 at a Japanese auto parts maker.

Curious Mundi Editorial Team · November 4, 2026

Illustration of a square black-pixel code on a white card next to a phone showing it inside a scanning frame on screen.

A QR code is a grid of light and dark squares that act like the zeros and ones of a digital message. Three larger corner squares show the camera where the code is and which way it faces, and extra error-correction data lets it be read even when damaged. Masahiro Hara invented it at DENSO, in Japan, in 1994.

Why did a car parts company need a new code?

DENSO, a Japanese maker of car components, used barcodes to keep track of parts. A standard barcode, however, holds very little: about 20 alphanumeric characters, according to the Japan Patent Office, and it can't handle kanji, the characters used in written Japanese. So a division of the company started developing a two-dimensional code, and the project later moved to DENSO WAVE, a subsidiary of the group.

The name gives away the priority: QR stands for Quick Response. The goal was fast reading without having to line the scanner up carefully. In the auto industry, the code was adopted for electronic kanban systems, the method that controls the restocking of parts on the production line, and it later spread to tracking food and medicines.

What are the three squares in the corners for?

They are the position detection patterns, the cleverest part of the design. Hara studied everyday printed material and patterns looking for a sequence that would almost never appear by chance. He landed on black, white, black, white and black bands in a 1:1:3:1:1 ratio.

The trick is that this ratio holds along any line that passes through the center of the square. So the scanner can find all three corners even if the code is sideways, tilted or upside down, and work out its orientation without anyone lining anything up. Once three corners are found, the software knows where the fourth one is and can straighten the image before reading the content.

What else is inside a QR code?

Besides the three corners, a standard QR code has other parts with well-defined jobs:

  • Timing patterns: rows of alternating black and white squares that act as a ruler, so the reader knows where each row and column sits.
  • Alignment pattern: a smaller square that helps correct distortion, such as when a code is photographed at an angle.
  • Quiet zone: a blank margin four modules wide around the code that separates it from the rest of the page.
  • Data area: everything else, holding the message and the extra error-correction bits.

The size grows with the amount of information. There are 40 versions of the standard QR code: the smallest is 21 by 21 modules, and each version adds four modules per side, up to the largest at 177 by 177. At the limit, one code holds 7,089 digits, 4,296 alphanumeric characters or 1,817 kanji, according to KEYENCE, a maker of code readers.

How can a QR code still work when it's torn or dirty?

Along with the message, the code stores redundant information calculated mathematically from the data itself. If some of the squares can't be read, the scanner uses that redundancy to rebuild what's missing. Whoever creates the code picks one of four error-correction levels:

LevelShare of the code that can be recovered
L (low)about 7%
M (medium)about 15%
Q (quartile)about 25%
H (high)about 30%

There's a trade-off. The more correction, the more space it takes up, and the code needs more modules to hold the same message. Choosing a level means choosing between fitting more data and surviving more damage. The rebuilding is done by an algorithm, a word that, by the way, has a history much older than computing.

Why can anyone make a QR code for free?

This is one of the secrets of its success. DENSO WAVE kept the patent rights but chose not to exercise them, and it made the specification open so any company could create and read QR codes without paying anything. What the company did keep was the name: QR Code is a registered trademark of DENSO WAVE.

Standardization followed quickly. The format became a standard of AIM, the international automatic identification industry association, in 1997, and an ISO/IEC standard in 2000. With a free and official specification, makers of scanners, printers and, later, apps could adopt it without asking permission.

Once a standard spreads, it tends to stick, as the story of why the keyboard is QWERTY and not in alphabetical order shows. The little square created to label car parts now turns up on restaurant menus, tickets, bills and packaging. According to DENSO itself, even one of its original developers doubted it would ever replace barcodes in retail.

Sources

Read next