What’s A QR Code And How Is It Different From A Barcode?

Table of Contents (click to expand)

The main difference between a barcode and a QR code is that a barcode is one-dimensional (it stores data only in the horizontal direction), while a QR code is two-dimensional (it stores data both horizontally and vertically). As a result, a standard 12-digit UPC barcode holds about 12 characters, whereas a QR code can hold up to 7,089 numeric or 4,296 alphanumeric characters. QR codes also include built-in error correction, so they keep working even when partially dirty or damaged.

A few days ago, I went to a grocery store with a friend. At the billing counter, the seller routinely flashed a handheld device at a specific point on the product’s packaging, and just as the device was “beeping,” he picked another product and repeated the same process.

“You see these black parallel lines? They form a barcode,” my friend informed me.

“Yes, I know, but do you know what they do?” I asked, to which he flashed the following expression:

We encounter barcodes almost every time we buy something in a store, but what do they actually do? And how do they differ from the increasingly popular QR codes?


Recommended Video for you:



What Is A Barcode?

Anyone who buys stuff from stores must have seen barcodes; however, whether or not they realize it’s a barcode they are looking at is a different matter altogether!

A barcode is a visual representation of machine-readable information about the product they are attached to.

To the layman, a barcode is a small box printed on the packaging of a product and has a small collection of black parallel lines of varying widths.

What’s A QR Code And How Is It Different From A Barcode?

This is not just another box printed on the cover of the product. It also contains important information (such as the manufacturer’s name, product type, and price) that can only be read by special barcode scanners. Since the data is stored in a single horizontal direction, this kind of barcode is also called a linear or 1D (one-dimensional) barcode. The most familiar example is the 12-digit UPC barcode you see on packaged groceries in the United States, while the European EAN-13 variant carries 13 digits.

What Is A QR Code?

Sanning qr code
Credit: sepy/Fotolia

The Quick Response code, almost always abbreviated as QR code, is closely related to a barcode. In fact, the international standard that defines it (ISO/IEC 18004) classifies the QR code as a kind of two-dimensional, or "matrix," barcode. Like a regular barcode, it stores machine-readable information about the thing it is attached to. Unlike a 1D barcode, however, a QR code is two-dimensional, meaning it stores data in both the vertical and the horizontal directions. The format was invented in 1994 by Masahiro Hara and his team at Denso Wave, a Toyota subsidiary, who needed a way to track auto parts faster than a regular barcode allowed.

QR codes contain a lot of information. From large companies to the grocery store next door, everyone can create their own QR code and attach it to their products. For example, the QR code of the URL of our website reads:

QR code of www.scienceabc.com
QR code of www.scienceabc.com

QR codes exploded in popularity once smartphones became universal. In the early days, you needed to install a dedicated scanner app, but that changed when Apple added QR scanning straight into the iOS camera in 2017, with Android following soon after. Today, on essentially any modern phone, you just point the camera at a QR code and a notification offers the pre-set action attached to that code (opening a web page, joining a Wi-Fi network, paying a bill, downloading an app, and so on). The pandemic accelerated this even further: contactless restaurant menus, payments, and vaccine certificates pushed QR codes into the everyday lives of US, UK, Australian, and Canadian consumers.

How Does A QR Code Differ From A Barcode?

Although both QR codes and barcodes serve the basic purpose of storing information about a particular product or organization, there are some major differences between them.

Appearance

One of the biggest differences comes in terms of the differences between their design or simply how they look. Take a look at the QR code and barcode of the URL of our website www.scienceabc.com.

science abc barcodes
QR vs barcode image scienceabc.com

The one can be easily distinguished from the other by a cursory glance.

Information Retention Capacity

This follows directly from the design of the two codes. A linear barcode stores information only along the horizontal axis, while a QR code stores it along both axes, hence the name "2-dimensional code." The practical difference in capacity is dramatic. A 12-digit UPC-A barcode (the standard on packaged products in the United States) carries just 12 numeric digits. By contrast, the largest QR code (Version 40, the densest 177×177 grid) can store up to 7,089 numeric characters, 4,296 alphanumeric characters, or roughly 2,953 bytes of raw data. That works out to several hundred times more information packed into a code of comparable physical size.

Adaptation And Error Correction

This is by far the most useful advantage QR codes have over conventional barcodes. Despite a phrase you’ll see repeated all over the internet, QR codes do not have an "error rate" of 7-30%. What they actually have is built-in error correction capability: the format uses Reed-Solomon coding to add redundant data so that a damaged code can still be recovered. The QR specification defines four selectable correction levels (L, M, Q, and H), which let you recover from roughly 7%, 15%, 25%, or 30% of the code being damaged, dirty, or obscured.

Put plainly, even if the packaging or the printed code is scuffed or smudged, the QR code still scans.

Companies make smart use of this feature. Because the error correction can compensate for the missing modules, businesses can drop a small logo or image right into the middle of a QR code (usually at the higher Q or H correction level) to make it instantly recognizable as theirs.

Barcodes have been around for more than half a century, with the first commercial scan taking place in 1974. QR codes are the newer technology (born in 1994) but they have unmistakably won the consumer space, especially after the contactless surge of the pandemic. A 1D barcode is still the workhorse of grocery checkout, where its job (encode a short product ID) hasn’t changed. The QR code, by contrast, has become the default for anything that needs to point a phone at the internet, from restaurant menus and parking-meter payments to airline boarding passes and event tickets.


When Were Barcodes And QR Codes Invented?

The two technologies are separated by about four decades and very different industries.

The barcode was conceived in 1948 by Norman Joseph Woodland and Bernard Silver, two graduate students at Drexel Institute of Technology in Philadelphia, after a supermarket executive asked their dean for a way to automate checkout. Their U.S. patent (No. 2,612,994) was granted in 1952. The first commercial scan of the modern UPC barcode came much later: a 10-pack of Wrigley’s Juicy Fruit gum at a Marsh Supermarket in Troy, Ohio, on June 26, 1974.

The QR code was invented in 1994 by engineer Masahiro Hara and a small team at Denso Wave, a Japanese subsidiary of the Toyota group. They needed a way to track car parts on the assembly line faster than 1D barcodes allowed, with a code that could be read from any angle and could still be decoded if partially obscured by oil or scratches. Hara has said the layout of the black-and-white squares was inspired by the board game Go. Denso Wave chose to make the format open, which is why it spread far beyond the auto industry. The current international standard is ISO/IEC 18004:2024.

Are QR Codes Safe To Scan?

Mostly yes, but with the same caution you’d apply to any link you click. Because a QR code is just a visual wrapper around a URL or piece of data, the risk lives in whatever the code points to, not in the code itself. The phone simply opens the link, joins the Wi-Fi, or starts the payment that the code encodes.

The catch is that you can’t read a QR code with your eyes, which is exactly what scammers exploit. The U.S. Federal Trade Commission and the U.K.’s National Cyber Security Centre have both warned about "quishing" (QR-code phishing), in which attackers stick fake QR stickers over real ones on parking meters, EV chargers, and restaurant tables, or send them in spoofed emails, to push victims to a fake login page. A few sensible habits keep you safe: pause on the preview URL your phone shows before tapping it, treat unsolicited QR codes in emails or unexpected packages the same way you’d treat a stranger handing you a link, and avoid scanning codes that look like a sticker pasted over the original.

References (click to expand)
  1. History of QR Code. Denso Wave (inventor of the QR code)
  2. Information capacity and versions of QR Code. Denso Wave
  3. Error correction capability of QR Code. Denso Wave
  4. ISO/IEC 18004:2024 (QR Code bar code symbology specification). International Organization for Standardization
  5. QR Code. Encyclopaedia Britannica
  6. The history of the barcode. GS1 UK
  7. QR Codes: Explained. New York University
  8. Research Guides: What are QR Codes? Harvard Library
  9. Scammers hide harmful links in QR codes to steal your information. U.S. Federal Trade Commission