The Man Who Invented QR Codes

Season 2 • Episode 14

In 1994, Masahiro Hara, working at a Toyota car-parts subsidiary, got tired of having to scan six or seven barcodes on every box of parts that zoomed past on the assembly line. Why, he wondered, were we still using the standard barcode—a bunch of closely spaced parallel lines—that we’d been using since the 70s? Why couldn’t someone invent a barcode that used two dimensions instead of one… could work from any angle or distance…could work even if it got smudged or torn? 

And so, studying a game of Go, he dreamed up what we now know as the QR Code, the one you scan with your phone. It’s the square barcode that shows up on restaurant menus, billboards, magazine ads—even tattoos and gravestones. But even that, says Hara-san, is only the beginning.

Episode transcript

Intro

Even if you don’t know what a QR code is, you actually do. You’ve seen it hundreds of times. It’s a printed square made up of black-and-white square pixels in weird patterns. They show up on ads, business cards, tickets, restaurant menus… You point your phone’s camera at it, and boom—it opens up a website, or a menu, or a show ticket. 

Pogue Do you remember the day that you came up with this idea? How old were you? Where were you? 

Translator Yes, I remember very clearly. It was early 1993, when I was 34 and when I was playing Go, which is a board game, during a lunch break. The concept of putting black and white dots on a grid occurred to me. 

It’s rare to find a cultural element as global and ubiquitous as a QR code…that was basically invented by a single guy. And today, you’ll get to meet him.

I’m David Pogue, and this is “Unsung Science.” 

First Ad

Season 2, episode 14…The Man Who Invented QR Codes!

Yes, that’s right. I’m going to devote an entire episode to the invention of a barcode. 

I do realize that if I really want to soar to the top of the podcast charts, this is not the right topic. I should do true crime, or partisan politics, or answer your sex questions. But you know what? I believe in myself, and my interests. I have integrity, and so do you. So…barcodes it is. 

You’ve seen thousands of barcodes in your life. On every single thing sold in every single store. Every bottle, box, bag, can, carton, container, crate, jar, jug, packet, pouch, pack, pallet, sack, and tube… has a barcode.

It’s that little patch of thick and thin lines, stripes, like unevenly spaced fence posts or jail bars. The cashier scans that barcode, or you do, and presto—

Beep! of a checkout scan

…the cash register knows what item you’ve bought and what the price is. And the store now knows that you’ve depleted its inventory of that item by one. 

In the pre-barcode days, the cashier had to look for a price tag on every single thing, and manually type the price into the register…

Cash-register tabulation sounds

…which was tedious and error-prone and gave you carpal tunnel syndrome.

Cash-register tabulation sounds, followed by “ow.”

What I’m describing, of course, is a UPC barcode. Universal Product Code. It came along in the 1970s, when the grocery-store industry decided that they’d had quite enough of the old—

Cash-register tabulation sounds, followed by “ow.”

It was time to modernize. They opened up a competition to see which tech company could design the best scannable barcode, and in 1972, IBM was the winner. It designed this barcode based roughly on Morse code, with its alternation of short and long tones…

Morse-code sound

…only this time, it was thick and thin lines read by a laser beam.

And in the summer of 1974, the first store rang up the first sale of the first item ever bought by having its UPC barcode scanned. 

Beep! of a checkout scan

It was a pack of Juicy Fruit gum, for 67 cents—a purchase so culturally significant that there’s a replica of that pack of gum in the Smithsonian. 

Now, at checkout, the UPC code was much faster and more accurate than human eye-hand coordination. But as human-computer interfaces go, it was really pretty crude. 

Problem #1:

Beep! 

These barcodes are one-dimensional. If the code isn’t perfectly perpendicular to the laser beam reading it, you get an error. Of course, IBM’s design features two laser beams, forming an X, inside the scanner, so you can be a little sloppier with your barcode positioning. But still, it sometimes takes a few tries to get it to read.

Problem #2:

Beep! 

…was tolerance for errors: the UPC didn’t have much. So if par t of the barcode is torn away, or smeared, or partly covered by a Sharpie mark or an oil stain, the machine can’t read it.

And problem #3:

Beep! 

The standard UPC barcode doesn’t store much data. Its entire readout, in fact, is 12 digits. And the biggest number you can describe with 12 digits is twelve 9’s in a row—just shy of 1 trillion. It’s 999 billion, 999 million, and so on.

Everything sold in every single store has its own unique UPC number. A 20-ounce bottle of Heinz ketchup is always 013000013673. For half-inch Scotch Magic Tape, it’s 021200000041. So in theory, the UPC system should be able to identify a trillion different products, right?

Wrong. 

Turns out the first six digits identify the company. The barcode for every product from Procter & Gamble, for example, begins with 003800, whether it’s Febreze, Pampers, or Tide.

Then the next 5 digits identify the product within that company’s portfolio. Procter & Gamble, for example, makes Joy Lemon Scent Dish Soap, 21737.

Now, if you’re following along at home, you may realize that we’ve accounted for only 11 digits. Six for the company, five for its product. What about the twelfth number in the barcode?

That’s a checksum—a digit that confirms that this is a real UPC code, and that it’s been scanned correctly. This is super wonky, but I’m going to get into this, because it’s kind of fascinating: To see if a UPC code is real, you add up the numbers in the odd-numbered positions and multiply by three. Then you add in the digits in the even-numbered positions. Divide your answer by 10, subtract that answer from 10, and voila: You’ve just calculated the final digit of the UPC code. The checksum. 

Credit cards use a checksum system, too. That’s why you can’t make up a credit-card number.

Just for fun, I looked up the barcodes 111111111111 and 222222222222. Those turn out to be invalid codes, because the checksum comes out wrong. 555555555555 works, though. That’s an actual product. It’s an L-shaped pillow for breastfeeding babies called the Jolly Jumper Boomerang Nursing Cushion. 

See what you can learn from podcasts?

Anyway, bottom line is that UPC codes will run out after far fewer than a trillion products. The limit is more like a few billion. And we’re getting to that point. Have you seen how many flavors of Oreos there are?

Over the years, various UPC code systems with expanded capacity have come along. But all those barcodes are still one-dimensional, error-prone, and limited. 

Which is why this episode is not about UPC barcodes. It’s about their spiritual successor: The QR code.

Now, you may or may not know the term QR code, or what it stands for: “Quick Response.” But you’ve certainly seen a QR code. It’s that square computery pattern, made up of little square black-and-white pixels, that shows up on things like billboards, magazine ads, business cards, tickets, and restaurant menus. You show it to your phone’s camera, and it does something. It opens a web page with more information, or shows you the restaurant menu. You might have used a QR code to check into a hotel, or log into a web site. A QR scan can pinpoint a location on a map, display a message or a picture, download a PDF file, auto-connect to a WiFi network, or pay for something.

QR codes appear in books. They show up on baseball tickets in Japan. You even see QR codes during TV shows or TV ads, to scan from the couch. 

In some countries, during the pandemic, you had to scan a QR code at stores and restaurants to show that you were there, for contact-tracing purposes. In other countries, vendors have set up entire virtual stores in train stations—basically a wall of photos of items you can order on the spot, by scanning their QR codes.

Nigeria, Russia, and the Netherlands have released bills or even coins with QR codes on them, which you can scan to read up on some historical national info.

In China and other countries, QR codes serve as sort of interactive price tags: You scan the QR code for an item, and your phone says, “Pay 12 bucks?” or whatever—and with one tap, you’ve paid. This system is so fast and easy that almost nobody uses cash anymore in China. Stores, cabs, subways, movie theaters, street vendors, street performers, even people experiencing homelessness have QR codes for easy paying. 

So yeah. QR is everywhere.

So what is this thing? Where did it come from? And who invented it? And is he a multimillionaire?

Well, we found him. He’s alive and well, in his mid-sixties, living in Japan, surrounded by shelves full of awards.

Pogue When you go to parties, when you go to meetings, do people know who you are? 

Translator Yes, I believe so. Especially with these days after and the honor of winning multiple awards, people started to recognize my achievement of developing QR code. So sometimes I was asked to take a photo. So gradually, yeah, people recognize. 

This is the voice of Masahiro Hara, the man who invented the QR code. 

Actually, it’s not. This is the voice of Masahiro Hara:

Hara: Same response in Japanese

But in an “Unsung Science” first, I conducted this interview with him over Zoom, with his colleague Yoshihiro Okamoto serving as translator. 

Hara-San was born in Tokyo in 1957. Yeah—I’m going to refer to Masahiro Hara as Hara-San, because in Japan, that’s how you refer to someone with respect. “San” kind of means “the honorable” or “good sir.”

So. Hara-san graduated college in 1977, and got his first job at Denso, a Japanese car-parts manufacturer, a subsidiary of Toyota. He was still at Denso in the early 90s, when the Japanese economy wasn’t in great shape. Every company was trying to boost productivity. 

And you wanna know what was extremely unproductive? Trying to find the right box of parts on the Denso assembly line. Every box scrolling by had multiple UPC-style barcode stickers on it. You’d have to scan every one of them with your handheld scanner gun to figure out what was inside. It was super inefficient, and also a pain in the butt.

Translator There were cases where we put ten barcodes side by side, and read it one by one. So it’s very inefficient at that time. 

Hara-san was 34 years old, and he’d had enough of scanning eight or ten stickers on every box of car parts. 

Pogue Did somebody ask you to create a new barcode? Was that an idea from your boss, or did you just independently say, “I think we need a better barcode?”

Translator The idea occurred to me on my own. 

Pogue Do you remember the day that you came up with this idea? How old were you? Where were you? 

Translator Yes, I remember very clearly. It was early 1993, when I was 34 and when I was playing Go, which is a board game, during a lunch break. The concept of putting black and white dots on a grid occurred to me.

It may have been the most important lunch break of his life.

Go is an ancient Chinese board game where you and your opponent each have these round, white or black stones. They look kind of like Mentos, or oversized M&Ms. The object is to place them strategically on a 19 by 19 grid in such a way that they fence in your opponent’s stones.

If you saw a Go board after a game, pictured side-by-side with a QR code, you’ll definitely see the family resemblance.

Anyway, the key to this Eureka moment was that UPC barcodes are one-dimensional. If the code were square instead, two-dimensional, you’d be able to store so much more data.

So Hara-san told his bosses that he wanted to develop a new, improved scannable code for Denso’s car parts. As translator Okamoto-san puts it,

Hara-san: When he decided to develop this, he told his boss that that he’ll do it in two years.

Pogue Wow. How long did it take? 

Translator Exactly two years. 

The first challenge was figuring out how the scanner camera would know when it was looking at a QR code—to differentiate the code from whatever text surrounded it on the page or the box. How could he teach the software to pluck out the QR code from its surroundings?

And then, one morning on the train to work, buildings were flashing by. Façade after façade, each full of windows in identical rows and columns. 

But suddenly, one building jumped out at him: In a bit of whimsy, the architect had designed the windows at the top and bottom of the building to be different shapes and sizes. 

Maybe that was the key. Maybe he could put special locator symbols, finder symbols, at the corners of his code that would tell the scanner, “Yo! Start interpreting this as data!” 

But what would those finder symbols be?

Translator So in order to distinguish QR codes from letters and figures, I investigated various printed materials to find shapes that are rarely used in the work at that time. 

It had to be a really unusual symbol, something that would never ordinarily appear in printed material. Otherwise, the scanner might try to read something that was unreadable. 

Hara-san studied fliers, boxes, newspapers, magazines, and books, in multiple languages, trying to find something that wasn’t there—a symbol that nobody was using. 

What he came up with was simple and elegant: A solid black square, with a black frame around it, like a little cubist eyeball. A square inside a square. Turns out that symbol almost never appears in any other context. It’s not part of any alphabet.

If you look at a QR code, you’ll see three of these finder symbols, at three of the four corners of the square barcode.

Pogue Why three and not four? 

Translator Because QR code is a square, so if, you know, the—two lines you can define what is the other one, where the other one is, where the other one is. 

In other words, if the software knows where three of the corners are, it can figure out where the fourth one is.

 Pogue Did you try any other designs that didn’t work well? Other patterns, other shapes? 

Translator Yes, there are some other ideas, especially for making a finder symbol. And for example, there was an idea to make a triangle or circle in the corner. 

Pogue But square worked better? 

Translator Yes, square worked better. 

Once the computer knows that it has encountered a QR code on the page, and knows where its boundaries are, it knows the code’s orientation, and it can begin to read the actual data—that ocean of tiny square pixels. 

Translator Okay, so a scanner, which is a camera, first takes image by its camera. Then it recognizes the finder pattern, as we discussed, in the QR code. And then from the three finder patterns, the scanner identifies the outline of the QR code and reads the black and white pattern of each cell. Then finally, it shows the characters contained in the code, and it is done in 16 milliseconds. 

The software starts reading from the lower right, where the very first cluster of dots tells the software whether this message is going to be a number, some text, or some Japanese characters. The next cluster of dots specifies how long this message is going to be—how many numbers or characters. 

The analysis zigzags through the rest of those pixels like a tractor mowing a field: It scans upward until it hits the first cubist eyeball, then turns around and scans down the next column to the left. Hits the bottom, doubles back and scans up the third column, and so on. 

Eventually, it encounters a special cluster called the “end indicator,” meaning, “This is the end of the message.” But the scanning isn’t over yet. At this point, the path continues with error-correction data—kind of like that checksum digit in the UPC code, but much, much more detailed. It’s almost like a backup of the QR’s encoded data.

All told, a single QR code can store over 7,000 numbers, or about 3,000 typed characters. The grid of dots can be as small as 21 rows and columns, or as big as 177 by 177.

The real genius of the design, though, is not just the amount of data it stores; it’s how fast and flexible it is for reading.

Translator QR code can store 200 times more information than barcode, and it can be read from anywhere in 360 degrees quickly. And also it can be read even if part of the code is damaged or covered with dirt, which barcode cannot. 

In fact, even if you smudge or cover or tear away as much as 30% of a QR code, the information still comes through to your phone. That’s how much error-correction and redundancy is built into the design. 

Sometimes, companies dress up a QR code with their logo, or some little graphic in the middle. I saw that on a cereal box recently. They can do that because of this error-correction. The scanner says, “oh dear, there’s a chunk of this code covered up by some graphic—but I don’t care! I can still get the data!”

You can be amazingly sloppy with the angle or distance of your phone. That made it a huge hit in the Denso car-parts factory. You could reliably scan boxes that had weird shapes, sitting at odd angles as they zoomed by on the conveyor belt. 

After two years of effort, Masahiro Hara had achieved his goal.

Pogue Were your bosses very happy? Did you get a raise? Did they have a party for you? 

Translator Actually, my bosses were not so excited when I first showed them the QR code. It Is because they did not know how much it would be used, or generate new business with this new code. 

Well, great. Two years of genius effort, and Hara-san is rewarded with a big yawn from management.

Obviously, there’s more to the story. In particular, there were four seismic cultural events that changed the course of history—and brought QR codes to global domination. I’ll let you know about ‘em…after the break!

Second ad break

Before I get back to QR codes, I gotta tell you something really funny.

After we record an interview for this show, we feed it into an AI transcription website called Trint to convert it into a written document, so I can write my script.

The accuracy is not flawless. So I hire a wonderful person named Oli via Noble to listen through the interview and fix the Trint transcript.

Now, Trint is capable of transcribing 33 languages—but you can choose only one language per recording. My conversation with Hara-san included both Japanese and English, so I chose English and clicked Transcribe.

WELL! Trint did its best trying to transcribe the AUDIO of Hara-san’s answers in Japanese—into English syllables that SOUND like what he said, even if they make no sense as sentences.

So, for example, when Hara-San said:

Hara: [00:27:39 (excerpt)

…Trint treated him as an English speaker saying this:

Olivia: Oh. And of course, they got like Scott Bakula crying, also looking to get them.

That’s Olivia herself, reading these comic gems. Here’s another one:

Olivia:  So we just got a kick out of my Yoda knuckles. I could not shake your head on.} 

And who doesn’t get a kick out of Yoda knuckles??

OK, OK, just one more. 

Olivia:  I’m sure, according to psychologist and Uncle Sam, somebody just took our idea based on all the dictum, one of the most radical terminology in the Middle East.

So great. Well done, Olivia. 

OK. That was just a little comic interlude for ya. Now, back to our story in progress.

Hara-San had indeed licked the problems of traditional barcodes. But his bosses failed to appreciate the QR code’s genius and its majesty. What they wanted to know was, how’s it going to make us money?

Translator They did not know how much it would be used, or generate new business with this new code. And so they told me that you should go to the market first, then see how, you know, potential customers respond. 

So Hara-san took his invention to auto-industry trade shows and gave demos to potential clients. 

Translator Fortunately, we got a very good response from the potential customers. So that makes, you know, my bosses’ response gradually different. And there was a party for me six years after the code was invented. 

Pogue That’s a little late. 

Once the Denso executives saw that the QR code had money-making potential, they made a crucial decision: Give away the technology. Don’t defend the patent. 

Pogue Why did Denso make the QR code format available to the whole public? How would the company profit from the QR code becoming popular? 

Translator Denso’s company strength is manufacturing. So our strategy was to develop business with readers, code readers, for QR codes. 

Pogue Oh, I see. So you give away the code and then you charge for the reading machines. It’s like, like razors and razor blades, right? 

Hara-san Yes, I think so, too. It’s a similar model. 

Pretty soon, all the car companies were using QR codes. Then advertisers. Then the Japanese lottery. The QR code was a surprise hit—in Japan.

Pogue And by the way, we call it QR code for ‘quick response.’ Is it a different name in Japan? What did you call it? 

Translator In Japan, it’s also the same—quick response code. So we call it QR code too. 

But becoming a cultural triumph in Japan is one thing. It took decades for the QR code to achieve full world saturation. And it owes that ubiquity to four seismic cultural events.

First, the mad-cow disease scare. Don’t know if you remember that, but it was this horrifying neurological disease in cows that made them uncoordinated, nervous, or even violent, and then they died.

Anchor: In 1996, a lethal new disease appeared in Britain. 

Doctor: Patients present with difficulties in balance and walking. And the deterioration from first symptom to death takes only a matter of months.

In the nineties, a couple of hundred people died after eating contaminated beef, so there was a worldwide panic. Suddenly, it was really, really important to track every bite of beef, from the farm to the wrapped package in the grocery store. The QR code was an ideal tracking system.

The second big push came along in 2007, with the invention of the iPhone. Pretty soon, people could download a special app onto their smartphones, and read QR codes just by pointing the phone. You didn’t need to buy a special reader gun anymore. Sorry about that, Denso!

The third huge event: In 2017, both Apple and Google built QR scanning right into the Camera apps of their smartphones. No more downloading a special app!

Pogue Somewhere along the line 2017, the phone could read QR code just by itself, just in the camera app. Did they call you up and ask you about that? Did you know that was happening? 

Translator No, actually, they did not consult with us. But when this happened, I felt very happy, because I thought the QR code has been widely recognized all over the world. 

Today, you just open your Camera app and point it at a QR code. You don’t even take the picture. Instantly, a button appears, showing the website that will open when you tap it.

And the fourth push was a little thing called the global pandemic. During COVID, nobody wanted to handle a restaurant menu that might be infectious, or to pick up a brochure or whatever. Everything went touchless. The solution was—QR codes. Point your phone at a laminated card on the restaurant table, and the latest menu or wine list appears on its screen. Saves the restaurant money, makes it easy to update the menu, and keeps your grubby mitts off of physical menus.

Suddenly, QR codes went mainstream. 

Today, Masahiro Hara is still working at Denso after 46 years. And he’s still developing the QR code’s successors. Like, what if you could wear a QR code on a bracelet or necklace with all your medical records? 

Translator What I am working on now is to put information about someone’s X-ray data or heartbeat data. So when someone goes to the hospital, if he or she can show that kind of information, he can or she can have a smooth and quick diagnosis in the hospital. 

He’s experimented with color QR codes, too, going beyond black-and-white to pack even more data into a tiny space—maybe even videos.

And he’s already introduced the SQRC—the secure QR code, where part of the code is encrypted, and can only be read by a special scanner.  

Translator: As a result, it is used to poll amusement park tickets and also for traceability. 

Of course, once you’ve got a secure portion of the code, that can’t be faked or duplicated, all kinds of possibilities open up. For example, you know those employee security badges that get you into secure areas of a building? Hara-San has come up with a way to make them un-impersonatable, using those same SQRC’s.

It works like this: Your employee photo is embedded into the encrypted code on your badge. Now you show up for work, at the nuclear facility or gold-bar storage company or whatever.

Translator: To verify the person, he or she goes in front of the camera and holds SQRC held up by the dedicated reader. 

At this point, a camera compares what you actually look like, standing there, with the stored image of your face on your badge. And if they match, you get to go in.

Translator: You can even use this system in an environment not connected to the Internet. So as a result, this system is used for access control, or it can also prevent impersonation. 

Pogue Your QR code obviously became very successful. Was that because of your skill and your good ideas, or was there some part of luck and timing? 

Translator It was my idea to develop a code that can be read quickly and reliably. But I was very lucky to be able to develop this before a cell phone or a smartphone with cameras become popular. 

Pogue I’ve heard of QR codes appearing on gravestones, which seemed surprising, but also a very good idea. Have you heard of any crazy examples of people using QR codes?

Translator Yes, I have seen people with QR code tattoos on their bodies in Japan in 2004. Then I heard their contact information in in there, so they exchanged their contact information by using a tattoo. 

That seems like a pretty cool idea—as long as you don’t think you’ll ever move or change your phone number for the rest of your life. Oh wait a minute, no—if your address changes, you’d just edit the website that opens up when you scan the QR code, like a restaurant changing its prices. Duh.

Pogue Did you have an idea that this could be very big? 

Translator The answer is yes and no. So when I went to the trade show and showed, showed especially industry-use customers this secure code, I had a very good response. So I thought it can spread in an industry use, but I could never imagine that it would be spread, you know, you know, usual consumers. So that was totally surprising to me.

Heroic, sunset music

I’m delighted to have met Masahiro Hara—truly one of the unsung engineers of our time—and to tell you his story. And when you look back over the arc of his career, I think one profound adage really sums it up. In the words of the Trint transcription:

Hara-san:  [00:21:13] But the real concrete sketches on display? Your eyes.

As I said goodbye to Hara-san and his translator Okomoto-san, Hara-san had a little surprise for me. 

Pogue [00:48:36] /you know, young people today, they might have posters on the wall of their sports heroes or their music heroes. If I had a poster on my wall, it would be of you. 

Hara-san [00:48:21] Thank you. Thank you for interview me.

That’s Hara-san himself, speaking his own English!

Pogue [00:48:25] Oh, you didn’t tell us you speak English! 

Translator [00:48:33] He can. 

Hara-san: I am happy that you are interesting in QR code.

https://worldcrunch.com/tech-science/qr-code-technology