What is a QR code?

Where QR codes came from, what they can hold, and why a phone camera can read one at an angle, upside down, and with a coffee ring across the corner.

Short answerA QR code is a two-dimensional barcode that stores data in a grid of black and white squares. Unlike a striped barcode, it can be read from any orientation and holds thousands of characters rather than a dozen, which is why it is used for web addresses.

Where it came from

QR stands for Quick Response. The format was developed in 1994 at Denso Wave, a Japanese company supplying the car industry, to track parts moving through factories. Ordinary striped barcodes were too slow and held too little: a scanner had to be lined up with the stripes, and a barcode could carry only a short part number.

The design brief was speed and tolerance. A code should be readable from any angle, at speed, by a scanner held by someone with better things to do — and it should still read when the label is scratched, smudged, or partly torn. Those two requirements produced nearly every feature of the format.

Denso Wave holds patents on the format but chose not to enforce them, and the specification was published as an international standard, ISO/IEC 18004. Anyone can generate and read QR codes without a licence or a royalty. The term “QR Code” itself is a registered trademark of Denso Wave.

Why a phone can read one from any angle

Look at any QR code and you will see three large squares-within-squares in the corners. These are finder patterns, and they are the reason scanning feels instant. Their ratio of black to white — 1:1:3:1:1 across any line through the centre — is rare in ordinary images, so software can sweep a camera frame for it cheaply.

Three corners are enough to establish where the code is, how big it is, and which way up it should be. The fourth corner is deliberately left without one, which is how the reader tells a rotated code from an upside-down one. Smaller alignment patterns elsewhere in larger codes correct for the distortion you get when scanning a label on a curved bottle or from an angle.

Damage is handled separately, by error correction — the subject of how QR codes work. Depending on the level chosen when the code is made, roughly 7% to 30% of the symbol can be destroyed and the data still recovered in full.

What a QR code can hold

A QR code holds characters, not files. How many depends on its version — the grid size, from 21 × 21 modules up to 177 × 177 — and on how much of the capacity is given over to error correction.

Maximum capacity at the largest version (40), by data type
Data typeLowest error correctionHighest error correction
Numbers only7,089 digits3,057 digits
Letters and digits4,296 characters1,852 characters
Any bytes (UTF-8 text)2,953 bytes1,273 bytes

Those are ceilings, not targets. A code holding four thousand characters has modules so small that it needs to be printed large and scanned close. In practice, a URL of fewer than a hundred characters keeps the code coarse enough to scan from across a room.

A QR code cannot contain a file. Every “PDF QR code” or “video QR code” is really a link to something hosted elsewhere — see PDF QR codes for what that means in practice.

What people put in them

The format is indifferent to meaning: it stores text. What gives that text a behaviour is a convention the scanning app recognises.

  • A URL — by far the most common. The phone offers to open it. This generator makes these, along with the Wi-Fi, text, email, phone, and SMS types below.
  • vCard or MeCard — contact details, which the phone offers to save. Compact but verbose enough to make a dense code. This site does not make them.
  • Wi-Fi credentials — a network name and password in a fixed format, which Android and iOS both understand. See the Wi-Fi QR code generator.
  • Plain text — displayed as-is, with no action offered. See the text QR code generator.
  • Email, phone, and SMS — mailto:, tel:, and SMSTO: links that open a draft email, a call, or a text message. See the email, phone, and SMS generators.
  • Payment data — many national payment systems define their own QR format on top of the standard.

The behaviour comes from the scanner, not the code. A phone that does not recognise a convention simply shows the raw text, which is why a URL is the safest choice for anything printed for the public.

Are they safe?

A QR code is a printed link, with one important difference: you cannot read it before you follow it. That gap is what makes them attractive to scammers, who cover a legitimate code — on a parking meter, a restaurant table, a delivery notice — with a sticker of their own.

  • Check the address your phone shows before tapping through. Every mainstream phone camera previews the URL.
  • Be suspicious of a sticker on top of printed material, especially where money is involved.
  • Treat a code that leads straight to a login form the way you would treat the same link in an email.

From the other side — if you are the one printing the code — the risk is different: your printed code is permanent and public. Anyone can photograph it and read the URL inside, so a code is never a way to keep an address secret.

Turn a link into a QR code, with nothing uploaded and no account:Open the generator

Related questions

Quick Response. The name refers to the speed of reading: the format was designed so a scanner could locate and decode the symbol in a fraction of a second, from any orientation.

A traditional barcode stores data in the width of stripes along one dimension, holding roughly a dozen characters and requiring the scanner to be lined up with it. A QR code uses both dimensions, holds thousands of characters, reads from any angle, and survives partial damage through built-in error correction.

No. Denso Wave, which invented the format, chose not to enforce its patents, and the specification is published as the open standard ISO/IEC 18004. Generating, printing, and scanning QR codes is free for any purpose, including commercial use.

Up to 7,089 digits or 2,953 bytes at the largest size with the lowest error correction. Practical codes hold far less: a web address of under a hundred characters keeps the pattern coarse enough to scan easily from a distance.