Skip to content

What is a QR code, and how does it work?

A QR code is a square, two-dimensional barcode that stores text, most often a web link, in a grid of black and white squares. A phone camera reads the grid and turns it back into that text. QR stands for Quick Response.

Where QR codes came from

The QR code was invented in 1994 by Denso Wave, a Japanese company in the Toyota group, to track car parts on production lines. The team, led by engineer Masahiro Hara, needed something that held far more than a normal barcode and could be read quickly from any angle.

Denso Wave holds the patent but chose not to enforce it, so anyone can make and read QR codes without paying a licence fee. That openness is a large part of why they spread from factories to tickets, payments, packaging and restaurant tables. "QR Code" itself is a registered trademark of Denso Wave.

The big shift for everyday use came when phones started reading QR codes in the standard camera app. Apple added it to the iPhone Camera in iOS 11 in 2017, and Android phones followed through Google Lens and their own camera apps. Since then you have not needed a separate app for most codes.

QR code vs barcode

A traditional barcode, like the one on a tin of beans, is one-dimensional. It stores a short number in the widths of its vertical lines, and the scanner reads across it in one direction. That number, such as a 13-digit EAN, only means something when a shop's database looks it up.

A QR code is two-dimensional. It stores data both across and down, so it holds far more in a smaller space, and the content can be meaningful on its own: a full web address, a Wi-Fi login or a contact card. It also includes position markers, so a camera can read it upside down or at an angle.

The parts of a QR code

Every QR code is made of small squares called modules. Some of them hold your data. The rest are fixed patterns that help the scanner find and read the code.

  • Finder patterns: the three large squares in the corners. They tell the scanner where the code is, how big it is and which way up it sits.
  • Alignment pattern: a smaller square near the fourth corner (larger codes have several). It helps correct for a curved or tilted surface.
  • Timing patterns: rows of alternating dark and light modules between the finder patterns, which set the grid spacing.
  • Format and version information: small strips next to the finders that record the error correction level and the mask used.
  • Data and error correction: everything else, your content plus the extra data that lets a damaged code still scan.
  • Quiet zone: the plain margin around the outside, ideally four modules wide. Without it many scanners fail.

How much a QR code can hold

QR codes come in 40 sizes, called versions. Version 1 is a grid of 21 by 21 modules. Each version adds four modules per side, up to version 40 at 177 by 177. The generator picks the smallest version that fits your content.

At its largest, a QR code holds up to 7,089 digits, 4,296 letters and numbers, or 2,953 bytes of general text. In practice you want far less. The more you put in, the denser the grid, and a dense code needs to be printed larger and scanned more carefully. A short link makes a simple, open code that scans from further away than a long paragraph of text ever will.

Error correction: why a scratched code still scans

QR codes use Reed-Solomon error correction, the same family of maths used on CDs. Extra data is added so the scanner can rebuild missing parts. There are four levels, and each one trades capacity for toughness.

  • L: about 7% of the code can be damaged and still read.
  • M: about 15%. A sensible default for most uses.
  • Q: about 25%. Good for codes on packaging or outdoors.
  • H: about 30%. Used when a logo covers the centre of the code.

Static and dynamic QR codes

A static QR code stores your content directly. Scan it and you get exactly what was encoded: your link, your Wi-Fi details, your contact card. Nothing sits in between, so it never expires and nobody tracks the scan. The trade-off is that you cannot change the content once it is printed.

The meaning of a dynamic QR code is different. It stores a short link that belongs to a QR code company, and that company's server forwards each scan to your real destination. You can change where it goes and see scan counts, but the code only works while the company keeps forwarding it, which usually means a paid plan. Our guide to static vs dynamic QR codes covers when each one makes sense.

Are QR codes safe?

A QR code cannot run anything on your phone by itself. It is just text. The risk is where that text takes you: a fake login page, a payment page that looks like your bank, or a download you did not ask for. Scams that swap in fake codes on parking meters and posters are common enough to have a name, quishing.

Your phone shows the address before opening it, so read it first. Be wary of short links, misspelt brand names and any page that asks for a password or card details straight after a scan. A scanner that checks links, such as NeoReader's QR scanner, flags look-alike domains, hidden destinations and bare IP addresses before you open anything.

How to make and scan a QR code

  1. To scan one, open your phone's camera, point it at the code and tap the link or notice that appears.
  2. To read a code on your computer screen or in a screenshot, upload or paste the image into a browser QR scanner.
  3. To make one, open a free QR code generator, choose what the code should hold (a link, Wi-Fi, a contact card and so on) and enter the details.
  4. Download it as PNG for screens, or SVG or PDF for print, and scan it with your own phone before you share it.

Read next

FAQ

Questions

What does QR code stand for?

Quick Response. The name comes from Denso Wave's original goal of a code that could be read quickly, from any angle.

What does a dynamic QR code mean?

It is a code that holds a short redirect link rather than your content. The provider's server forwards each scan, so the destination can be changed, but the code stops working if the provider stops forwarding it.

Do QR codes expire?

Static QR codes never expire, because the content is stored in the pattern. Dynamic codes can stop working when a subscription or trial ends.

Can a QR code hold a file or a photo?

Not in any practical way. A QR code holds a few thousand characters at most. For a file, upload it somewhere such as Google Drive and put the link in the code.

Who invented the QR code?

Masahiro Hara and his team at Denso Wave in Japan, in 1994, for tracking car parts.

Is a QR code the same as a barcode?

It is a type of barcode. Standard barcodes are one-dimensional and hold a short number; QR codes are two-dimensional and hold much more, including full links.