Decode one
Scan or paste a barcode and see every part of it.
Make one
Generate a valid barcode from fields.
Where you’ll see it
- Web links on packaging, posters and menus.
- Mobile tickets and passes, shown on a phone screen.
- Payments, in many countries.
- Products, more and more, as a GS1 Digital Link that carries the product’s GTIN in a web address. See Sunrise 2027.
- Pairing and setup: Wi-Fi networks, devices, accounts.
Anatomy
This example is a GS1 Digital Link: a web address that carries the product’s GTIN and batch.Versions
A QR Code’s size is called its version. Version 1 is 21×21 modules, and each version adds 4 modules to each side, up to version 40 at 177×177. An encoder picks the smallest version that fits the data at the chosen error correction level. From version 7 up, the version number is also stored in the code itself, in two blocks near the top-right and bottom-left finder patterns.What it can hold
In practice, keep it short. Every extra character makes the modules smaller at the same printed size. A short web address is much easier to scan than a long one.
Masks
Long runs of dark or light modules confuse scanners, so an encoder flips every module in a fixed pattern, called a mask, before printing the code. There are eight masks. The encoder tries all of them and keeps the one with the fewest problem patterns, then records which one it used in the format information.Quiet zone
A QR Code needs a light margin at least 4 modules wide on every side.Error correction
Every QR Code has one of four error correction levels, chosen when it’s made:
Use L for codes on screens, M for clean printed labels, and Q or H, printed larger, for codes on boxes that get damaged. See How much error correction should I use?
Variants and related types
- Micro QR Code: a smaller form with one finder pattern, for very little data.
- GS1 QR Code: a QR Code that starts with the GS1 special character FNC1 and carries GS1 element strings, like GS1-128. It’s rare. Most products use a GS1 Digital Link, which is an ordinary QR Code containing a web address.
- Data Matrix: smaller for the same data, common in healthcare and industry, but less familiar to phone users.
Gotchas
- A logo over the middle. It hides modules on purpose, so the code relies on error correction just to be read. Use level H and test it.
- Low contrast. Pale colors, gradients and dark-on-dark designs fail on many scanners even when they work on yours.
- A transparent background. A code sent as an image with a transparent background takes on the color behind it. In dark mode that’s a dark code on a dark screen, with no quiet zone, and it won’t scan. Make the white margin part of the image.
- Too small or too dense. A long URL at a small size makes modules too small for a phone to resolve. Shorten the URL or print larger.
- The content is untrusted. A QR Code can contain any web address, and a sticker can cover a real one. Check where a scanned link points before your app opens it.
Scanning it in your app
Specification
- ISO/IEC 18004: the QR Code barcode specification.
- GS1 Digital Link: carrying GS1 identifiers in a web address.