QR Codes Explained: How They Work and How to Make One That Scans Every Time

QR Codes Explained: How They Work and How to Make One That Scans Every Time — Preslo guide cover with the QR Code Generator tool

QR codes are on menus, posters, parcels, tickets and business cards, and most phones can read them straight from the camera app. Making one takes seconds, but making one that scans reliably on a crumpled flyer or a poster across a room takes a little understanding of how they work. This guide explains what is inside a QR code, how error correction and the quiet zone keep it readable, and how to print and share codes safely.

A short history

QR stands for "Quick Response". The format was developed in 1994 by Denso Wave, a Japanese company in the Toyota group, to track automotive parts faster than traditional barcodes allowed. A normal barcode stores information in one direction only, across a row of bars. A QR code stores it in two dimensions, across a grid, which lets it hold far more data in a small square and be read from any angle. The format was later published as an international standard, ISO/IEC 18004, and its patent holder chose not to enforce its rights, which helped it spread everywhere.

If you need a traditional one-dimensional barcode for product labels or inventory instead, that is a different format; Preslo has a separate Barcode Generator for those.

What a QR code actually stores

A QR code is a container for a short piece of text. That is all. When your phone opens a website after a scan, it is because the text happens to be a web address and the phone recognizes it as one. The same is true for phone numbers, emails and Wi-Fi details, which follow simple text conventions:

ContentWhat you encodeWhat a phone usually does
Websitehttps://example.com/menuOffers to open the link
Phone numbertel:+441234567890Offers to call
Emailmailto:[email protected]Opens a new email
Wi-FiWIFI:T:WPA;S:NetworkName;P:Password;;Offers to join the network
Plain textAny short message or reference numberShows the text

Behind the scenes, the standard has several encoding modes. Numeric mode packs digits most efficiently, alphanumeric mode handles uppercase letters, digits and a few symbols, and byte mode handles anything else, typically as UTF-8 text. That is why a long string of digits fits more easily than the same number of mixed characters, and why accented letters or non-Latin scripts, which take two to four bytes each in UTF-8, use up space faster.

The anatomy of a QR code

Look closely at any QR code and you will see more than random squares. The small squares are called modules, and some of them have fixed jobs:

  • Finder patterns: the three large squares in the corners. They let a scanner find the code, work out its size and tell which way up it is.
  • Alignment patterns: smaller squares, present in all but the smallest codes, that help correct for a code that is curved or seen at an angle.
  • Timing patterns: alternating dark and light lines between the finder patterns that help the scanner measure the grid.
  • Format information: strips near the finder patterns recording the error-correction level and the mask used.
  • Data and error-correction modules: everything else, carrying your content plus recovery data.

Before drawing the code, the encoder applies one of eight mask patterns that flip certain modules. The aim is to avoid large blocks of one color or patterns that look like finder squares, both of which confuse scanners. The encoder picks whichever mask gives the cleanest result.

Versions and capacity

QR codes come in 40 sizes called versions. Version 1 is a grid of 21 × 21 modules, and each version adds four modules to each side, up to version 40 at 177 × 177. More data needs a larger version, which means smaller modules at the same printed size. The table shows how many bytes fit at a few versions, for each error-correction level:

Version (grid)LowMediumQuartileHigh
1 (21 × 21)1714117
10 (57 × 57)271213151119
25 (117 × 117)1,273997715535
40 (177 × 177)2,9532,3311,6631,273

The absolute maximum is 7,089 digits in numeric mode at version 40 with low error correction. In practice you rarely want to get anywhere near these limits. A typical web address of around 30 characters fits in a 29 × 29 grid (version 3) at medium error correction, which stays easy to scan even when printed small. Shorter content gives bigger modules, and bigger modules scan faster and from further away.

Error correction: why a damaged code still works

QR codes include extra recovery data calculated with Reed–Solomon error correction, the same family of techniques used on CDs and in many digital communications. If part of the code is dirty, scratched or covered, the scanner can rebuild the missing data from what remains. There are four levels:

LevelApproximate recoveryTypical use
L (Low)about 7% of the dataLong content shown on clean screens
M (Medium)about 15%Most links, documents and business cards
Q (Quartile)about 25%Labels and stickers that may get scuffed
H (High)about 30%Outdoor signs, rough surfaces, harsh conditions

Higher levels are not free: the recovery data takes up space, so the same content needs a larger, denser grid. Medium is a sensible default for most uses. Choose Quartile or High when the printed code will face wear, and keep in mind that error correction cannot compensate for poor contrast or a missing quiet zone.

The quiet zone

The standard requires a blank margin around the code, called the quiet zone, at least four modules wide on every side. Scanners use this empty border to tell where the code ends and the surroundings begin. When designers crop the white margin to make a code fit, or place it right against text, a photo or a colored edge, scanning often becomes slow or fails entirely. The Preslo QR Code Generator always includes the four-module quiet zone in both the PNG and SVG downloads, so leave it in place when you add the image to your design.

Contrast, color and size for print

Most scanning problems come from how a code is printed rather than from the code itself. These guidelines help:

  1. Use dark modules on a light background. Black on white is the safest choice. Light-on-dark (inverted) codes are not read reliably by every scanner, and low-contrast color pairs such as pale grey on white or red on green may fail in poor light.
  2. Avoid busy backgrounds. Do not place a code over a photo or a pattern; put it on a plain light panel with its quiet zone intact.
  3. Make it big enough. About 2 × 2 cm is a practical minimum for close-up scanning, for example on a business card. A commonly used rule of thumb is to make the code at least one tenth of the expected scanning distance, so a code meant to be scanned from 2 metres away should be around 20 cm wide.
  4. Check the module size. A version 3 code with its quiet zone spans 37 modules. Printed 2 cm wide, each module is about 0.54 mm. Longer content means more modules and smaller ones at the same size, so shorten the content or enlarge the code.
  5. Use a high-resolution or vector file. For print, download a large PNG (1024 or 2048 px) or an SVG, which stays sharp at any size and works well in design and print software.
  6. Avoid glossy curves and folds. Reflective finishes, curved bottles and creases can all distort the grid.
  7. Test the final printed version. Scan a proof with more than one phone, in normal lighting, at the distance people will actually use.

Static versus dynamic QR codes

A static QR code contains your content directly. It never expires and needs no service to keep working, but the content cannot be changed after printing. A dynamic QR code contains a short link to a redirect service, which forwards people to the real destination. The owner can change that destination later and usually see scan statistics, but the code only works while the redirect service is running, which often depends on a subscription, and every scan passes through a third party.

The Preslo generator makes static codes only. It does not offer editable destinations, scan tracking, custom colors or logos; the code contains exactly what you typed. If you think the destination may change, a practical approach is to encode a link to a page on your own website and update that page whenever needed.

Staying safe with QR codes

Because people cannot read a QR code by eye, criminals use them to hide malicious links. This is sometimes called QR phishing or "quishing". Fake codes have been reported stuck over genuine ones on parking meters and posters, and printed in emails and letters that ask people to "verify" an account. To protect yourself:

  • Read the web address your camera shows before opening it, and check the domain carefully for misspellings.
  • Be wary of codes that ask you to log in, pay or download an app, especially on public signs or unexpected messages.
  • When in doubt, type the organisation's known web address yourself instead of scanning.
  • Check physical codes for signs of a sticker placed on top.
  • Remember that a Wi-Fi code reveals the network password to anyone who scans it.

If you create codes for others, encode a full https:// address on a domain people recognize rather than an unfamiliar short link, so people can see where they are going.

Key takeaways

  • A QR code stores a short piece of text; links, phone numbers and Wi-Fi details are just text conventions.
  • Shorter content gives larger modules, which scan more reliably.
  • Error correction recovers roughly 7%, 15%, 25% or 30% of the data at levels L, M, Q and H; Medium suits most uses.
  • Always keep the four-module quiet zone and use dark modules on a light background.
  • Print at least about 2 cm wide, larger for distance scanning, and test the final print.
  • Static codes, like those Preslo makes, never expire but cannot be edited; check every scanned link before you trust it.

Frequently asked questions

Do QR codes expire?

Static QR codes do not expire, because the content is stored in the code itself. Dynamic codes depend on a redirect service and stop working if that service ends.

Which error-correction level should I choose?

Medium is a good default for most links and documents. Choose Quartile or High for codes that will be printed outdoors or may get scratched or partly covered.

How small can a printed QR code be?

About 2 × 2 cm is a practical minimum for close-up scanning. For codes scanned from further away, a common rule of thumb is a width of at least one tenth of the scanning distance.

Can I change the link after printing a QR code?

Not with a static code, because the link is part of the image. If the destination might change, encode a link to a page you control and update that page instead.

Are QR codes safe to scan?

The code itself is just text, but it can point to a malicious website. Always check the address your phone shows before opening it, and be cautious with codes that ask for logins or payments.

More guides

See all guides →