What is a QR code and how does it work?

Updated · By QR ALTRIX

Quick answer

A QR code is a square, two-dimensional barcode that stores text, usually a web link. A phone camera reads the black and white squares, decodes the text and offers to open it. QR codes were invented in 1994 by Denso Wave in Japan, are defined by the ISO/IEC 18004 standard and are free for anyone to create and use.

What the squares mean

Every QR code is a grid of small squares called modules. A dark module is a 1 and a light module is a 0, so the grid is simply binary data laid out in two dimensions. That is why a QR code holds far more than a striped barcode, which only stores data in one direction.

Some parts of the grid are not data at all. They help the camera find and straighten the code before it reads anything:

  • Three large squares in the corners (finder patterns) tell the scanner where the code is and which way up it is.
  • Smaller alignment squares correct for a code printed on a curve or photographed at an angle.
  • Dotted timing lines between the corners give the scanner the size of each module.
  • Format information records the error-correction level and the mask pattern used.
  • A blank margin around the code, the quiet zone, separates it from everything else on the page.

How a phone reads it

The camera finds the three corner squares, works out the grid size, reads each module as dark or light, removes the mask and decodes the bytes. Built-in error correction (Reed-Solomon codes) lets it rebuild the content even if part of the code is dirty, scratched or covered by a logo. The whole process takes a fraction of a second.

The scanner then looks at what the text is. A web address is offered as a link, a WIFI: string joins a network, a vCard saves a contact. You can read any code from an image with the free online QR code scanner.

What a QR code can store

The largest QR code (version 40, 177 by 177 modules) holds up to 7,089 digits or 2,953 bytes of text at the lowest error-correction level. In practice most codes hold a short link, because short content makes a simpler pattern that scans faster. See how much data a QR code can hold.

Common contents are website links, Wi-Fi logins, contact cards, menus, PDFs and payment details.

Frequently asked questions

What does QR stand for?

Quick Response. The name comes from its original purpose: fast scanning of car parts in Japanese factories.

Is it free to make a QR code?

Yes. The QR code standard is free to use and you can create a QR code for free on QR ALTRIX, including dynamic codes.

Does a QR code need internet?

Reading the code does not. Opening a link inside it does. A Wi-Fi, text or contact code works fully offline.

Related