What Is a QR Code and How Does It Work?

Where QR codes come from

QR stands for Quick Response. The format was created in 1994 by Denso Wave, a Japanese company, to track car parts in factories. It was designed to be read quickly and to hold much more data than a traditional barcode. The standard is open and free to use.

What the squares do

  • Three large squares in the corners are finder patterns. They tell the scanner where the code is and which way is up.
  • A smaller alignment pattern helps correct distortion in larger codes.
  • Alternating dark and light cells form timing patterns that help the scanner measure the grid.
  • Format information stores the error correction level and data mask.
  • The remaining area holds the data itself.

How data and error correction work

The data can be stored as numbers only, letters and numbers, bytes or Japanese characters, and the generator picks the most compact mode that fits. It then adds extra error correction information using a method called Reed-Solomon coding. There are four levels, from L to H, that can recover roughly 7 percent to 30 percent of damaged data. This is why a scuffed or partly covered code can still scan.

How a phone reads a QR code

The camera captures the image, software finds the finder patterns, corrects perspective, reads the grid of dark and light cells and checks the error correction. The result is a piece of text. Most often it is a web address, but it can also be WiFi details, contact information or plain text.

Because the code can hide a link, read the decoded address before you open it.