The QR Code Was Invented in Japan

In 1994, an engineer named Masahiro Hara built the QR code to track car parts in Toyota factories. Here is why it looks the way it does, why its maker gave it away, and how it ended up everywhere.

A stylized QR code grid pattern
The QR code was built for a Toyota factory. (Illustration: Bayu Setiawan)

You have scanned one today, probably more than once. A menu, a payment, a ticket, a login. The black and white squares are so common now that they are almost invisible, a piece of infrastructure rather than an invention. But the QR code was invented, by a specific person, for a specific problem, in a specific place. It was invented in Japan, in 1994, by an engineer named Masahiro Hara, and it was built to track car parts in a Toyota factory.

A factory problem

In the early 1990s, Toyota's factories ran on barcodes, and barcodes had hit their limit. A standard barcode holds about 20 characters, and a single auto part needed 5 to 10 separate barcodes to carry the information required to identify it. Each one had to be scanned precisely, one at a time, and the scanning slowed down the production line. Toyota ran on kanban, its just-in-time system, where parts arrive exactly when they are needed and no sooner. A slow barcode was not a small annoyance. It was a bottleneck in the whole system.

In 1992, the manufacturing sites asked for something faster. The project landed with Masahiro Hara, a 35-year-old engineer at Denso Wave, a company in the Toyota group that made industrial equipment. Hara and one other engineer spent two years building something better. They wanted a code that could hold hundreds of characters, scan from any angle, and keep working even when it was partly damaged. In September 1994, they shipped the first version, and inside Toyota plants it worked.

Why it looks the way it does

A barcode is one-dimensional. It stores information in the width of its lines, in one direction only. Hara turned it into a two-dimensional grid, a matrix of black and white squares that stores data both horizontally and vertically. A QR code can hold up to 7,000 digits, or more than 4,000 letters and numbers, far more than a barcode, and it can be read much faster.

The most recognizable part of the design is the three large squares in the corners. They are the finder patterns, and they let any camera orient the code instantly, from any angle. Hara found the pattern by looking at the game of Go, the board game of black and white stones on a 19 by 19 grid, and he settled on a ratio of 1 to 1 to 3 to 1 to 1 for the squares, a pattern that never occurs naturally in print. That is why a scanner can find a QR code on a poster, a screen, or a curved surface without being told where to look.

The code also carries its own repair system. It uses Reed-Solomon error correction, which means a QR code can still be read when part of it is dirty, torn, or covered. That mattered on a factory floor, where a label gets scuffed, and it matters now, when a code is printed on a receipt or a poster in the rain. The name says what it was built for. QR stands for Quick Response, because the whole point was speed.

The decision that made it free

Here is the part that changed everything. Denso Wave held the patent on the QR code, but it chose not to enforce it. The company made the specification freely available to anyone who wanted to use it. No licensing fees, no royalties, no permission required. It became an AIM standard in 1997, a Japanese JIS standard in 1999, and an international ISO standard in 2000, published as ISO/IEC 18004. The name QR Code is still a registered trademark of Denso Wave, but the technology itself is free for anyone to use.

That decision is why the QR code is everywhere and its competitors are not. There were other two-dimensional codes, and some were technically better in one way or another. The QR code became ubiquitous not because it was the best code, but because it was free. Anyone could build a scanner or a generator without asking permission, and so everyone did.

From factories to everywhere

For almost twenty years after its invention, the QR code stayed mostly industrial. Factories, warehouses, logistics. A breakthrough came in 2002, when Sharp introduced a mobile phone with a built-in QR code reader, and the code began to appear in Japanese daily life, on posters, tickets, and magazines. Then it spread to China, where WeChat Pay and Alipay turned it into the standard way to pay, and then to the rest of the world. The COVID-19 pandemic pushed it further, as restaurants replaced paper menus with a code on the table and businesses replaced contact with a scan.

Today the code is scanned billions of times a day, and the global QR code market is valued at about 13 billion dollars. In Japan, you pay with a QR code at the convenience store, you show one to board a train, you scan one to read a menu. A tool built to track a car part now tracks almost everything, and almost nobody thinks about where it came from.

My take

What I like about the QR code is not the technology. It is the decision. Denso Wave could have charged for every scan, and for a while it would have made a lot of money. Instead it gave the code away, and in return the code became a standard, used by billions of people, in a way that no licensed product ever could have been. The company still exists, still makes car parts, still holds the trademark. It did not lose by giving the code away. It won, in a slower and larger way, by letting the code belong to everyone.

There is a lesson in that for anyone who builds something. The instinct is to protect an idea, to charge for it, to keep it close. Sometimes that is right. But sometimes the most valuable thing you can do with an idea is to let it go, and to trust that being useful to everyone is worth more than being profitable from a few. A small team in a Toyota-group factory in 1994 proved that, with a grid of black and white squares that now sits on every table, every poster, and every phone in the world.