GeneratorsBy Sam Holloway··Updated ·10 min read

QR Codes Explained: How They Work and How to Create Them

How QR codes work, what they can store, and how to create one. Use-case guide, error correction explained, and a print checklist before you deploy.

QR codes are now on restaurant tables, product packaging, event tickets, business cards, and payment screens. But most people have no idea how qr codes work beyond pointing a phone at one and waiting for something to happen. Understanding the mechanics behind them explains why they are so reliable, why one with a logo punched through the middle still scans, and how to create one that will scan reliably in the real world rather than only on a screen in ideal lighting.

What a QR code is

QR stands for Quick Response. A QR code is a two-dimensional barcode that encodes data as a pattern of black and white squares arranged in a grid. Unlike a traditional linear barcode that uses only horizontal information, a QR code uses both horizontal and vertical axes, allowing it to store far more data in a small physical space.

The standard was created by Denso Wave, a subsidiary of Toyota, in 1994 to track automotive parts through manufacturing. The design was built for high-speed scanning from any angle, which is why modern smartphones decode them in a fraction of a second regardless of rotation or mild perspective distortion.

How QR codes work: the structure

A QR code is divided into several functional regions, each serving a specific role in the scanning process.

  • Finder patterns: The three large square-in-square patterns in three corners of the code. They allow the scanner to locate the code and determine its orientation regardless of the angle it is viewed from.
  • Alignment pattern: A smaller square near the fourth corner, used in larger codes to compensate for image curvature or distortion, such as when a code is printed on a curved surface.
  • Timing pattern: An alternating black-and-white stripe connecting two of the finder patterns. It tells the scanner the size of each module (individual square unit) in the grid.
  • Format information: Strips adjacent to the finder patterns that encode the error correction level and the masking pattern used, so the scanner knows how to decode the data.
  • Data region: The remaining area of the code, which holds the actual encoded content plus redundant error correction data.

How your phone scans a QR code

When you point your camera at a QR code, the camera app or a dedicated scanner captures a frame and passes it to a decoder. The decoder first searches the image for the three finder patterns, which have a distinctive ratio of black and white areas (1:1:3:1:1) that makes them identifiable regardless of scale or rotation. Once the finder patterns are located, the decoder establishes the grid dimensions using the timing and alignment patterns.

The decoder then reads each module in the data region, applies the mask pattern (a specific mathematical transformation used during encoding to prevent large solid areas that could confuse scanners), and runs Reed-Solomon error correction to reconstruct any missing or damaged data. The result is the original encoded string, which the phone's operating system interprets: a URL becomes a browser prompt, Wi-Fi credentials trigger a join request, a vCard opens the contacts importer.

What a QR code can encode

The data region can hold several types of content. The type determines how your phone interprets the scan result.

  • URLs: The most common use. The phone prompts to open the link in a browser.
  • Plain text: Any text string up to the code's data capacity.
  • Email addresses: Opens a new email draft pre-addressed to the encoded address.
  • Phone numbers: Prompts the phone's dialler with the number pre-filled.
  • SMS: Opens a new text message pre-addressed and optionally pre-filled with a message body.
  • Wi-Fi credentials: Encodes a network SSID and password so scanning joins the network automatically, without typing.
  • vCards: Contact information in a standard format that imports directly into the phone's contacts app.
  • Calendar events: Encodes event details (title, date, time, location) that the phone can add to the calendar.
  • Geographic coordinates: Opens the phone's map app at the encoded latitude and longitude.
  • App store links: Deep links that open directly to an app listing on the App Store or Google Play.

QR code use cases by context

The same technology is used very differently depending on the context. Here is how QR codes are applied across the most common situations.

Restaurants and hospitality

Table tent QR codes linking to digital menus became standard during the pandemic and have stayed because they allow menus to be updated instantly without reprinting. The code on the table is printed once; the menu behind it can change daily. Hotels use QR codes on room key cards to link to check-out instructions, local recommendations, and room service menus.

Retail and product packaging

Product packaging QR codes link to detailed product information, assembly instructions, warranty registration, or reorder pages. For products with limited label space (cosmetics, supplements, electronics accessories), a QR code offloads long ingredient lists or compliance information to a web page rather than requiring microscopic print.

Events and ticketing

Event tickets with QR codes are scanned at the gate to verify validity and check in attendees. The code encodes a unique ticket identifier that is validated against the event's attendee database in real time. Conference name badges with QR codes let exhibitors scan attendees for lead capture with a single tap.

Business cards and networking

A vCard QR code on a business card lets someone add your contact details to their phone in two seconds without typing. For professionals who exchange cards frequently, this is a meaningful upgrade. The code encodes name, job title, company, phone, email, and website in a format the phone's contacts app imports directly.

Payments and finance

Payment QR codes encode a payment address or request. The payer scans the code, the payment app pre-fills the recipient and amount, and the payer confirms. This is the dominant payment method in several markets and is growing in use for contactless transactions at retail counters and peer-to-peer transfers.

Wi-Fi access

A Wi-Fi QR code printed on a router label, a wall card in a cafe, or a conference room screen lets guests join the network without asking for or typing the password. The code encodes the network name and password in a standard Wi-Fi format that Android and iOS both recognise natively.

Error correction levels explained

When generating a QR code you choose an error correction level, which controls how much of the code can be damaged or obscured before it fails to scan. Higher correction means more redundant data, which makes the code larger and denser but more resilient.

LevelRecovery capacityBest for
L (Low)Up to 7% data lossClean indoor environments, screens, digital use
M (Medium)Up to 15% data lossGeneral use, most printed materials
Q (Quarter)Up to 25% data lossOutdoor printing, industrial labels, packaging
H (High)Up to 30% data lossCodes with a logo overlay, rough surfaces

For most URL-based QR codes printed in a clean environment, Level M is the right default. If you plan to place a logo or brand mark over the centre of the code, use Level H to ensure the covered data can be reconstructed. Higher correction levels produce visually denser codes, but for short URLs the difference is minimal.

How to create a QR code

AlteredIdea's QR Code Generator creates codes for URLs, plain text, Wi-Fi credentials, contact cards, phone numbers, email addresses, and more. Select the content type, enter your data, choose the error correction level and size, and download as PNG or SVG. SVG is the right format for print because it scales to any size without losing quality.

  1. 1.Open the QR Code Generator. No account or login is needed.
  2. 2.Select the content type: URL, text, Wi-Fi, vCard, phone, email, or SMS.
  3. 3.Enter the content. For URLs, paste the full address including https://.
  4. 4.Choose the error correction level. Use M for most uses, H if you are adding a logo.
  5. 5.Set the output size. For print, choose SVG. For digital use, PNG at 1000px or above is sufficient.
  6. 6.Click Generate. Preview the code to confirm it looks clean and has an adequate quiet zone (white border).
  7. 7.Scan the generated code with your phone before downloading to confirm it resolves to the correct destination.
  8. 8.Download and place the file into your design, document, or print template.

Print checklist: before you send to the printer

Printing a QR code that does not scan is an expensive mistake. Run through this checklist before approving any print job that includes a QR code.

  1. 1.Scan the source file, not a screenshot. Scan the actual file you are sending to print, not a photo of it on screen. Screen glare and camera angle can make a non-scanning code appear to work.
  2. 2.Test on at least two different phones. iOS and Android camera apps use different decoders. A code that scans on one may not scan on the other if it is marginal.
  3. 3.Test at the intended print size. Print a test page at actual size and scan it under the same lighting conditions it will be used in. A code that scans on a monitor at 300% may fail at 2.5 cm in dim lighting.
  4. 4.Verify the quiet zone is intact. The white border around the code must be at least four module widths on all sides. Check that your layout has not cropped or placed design elements into this border.
  5. 5.Check the contrast. The dark modules must be clearly darker than the light modules. Avoid dark backgrounds or coloured codes that reduce contrast below about 40% difference in luminance.
  6. 6.Confirm the destination URL is live. Scan the code and verify the linked page loads correctly. A QR code pointing to a broken URL is indistinguishable from a working one until someone scans it.
  7. 7.For variable data (different codes per unit): test one from the beginning, one from the middle, and one from the end of the print run. Variable data printing errors are not always uniform.
  8. 8.Keep a digital copy of the final approved file. If the code needs to be reprinted, you want the exact file used, not a regenerated version that may have subtle differences.

QR code sizing guide

The minimum readable size depends on the scanning distance and the density of the code. Here are practical size guidelines for common print applications.

ApplicationMinimum sizeRecommended size
Business card2 cm x 2 cm2.5 cm x 2.5 cm
Flyer / A5 insert2.5 cm x 2.5 cm4 cm x 4 cm
Poster / A34 cm x 4 cm6 cm x 6 cm
Table tent / menu card3 cm x 3 cm5 cm x 5 cm
Large banner / signage8 cm x 8 cm15 cm x 15 cm or larger
Product packaging2 cm x 2 cm3 cm x 3 cm

Frequently asked questions

  1. 1.Why does a QR code with a logo in the middle still scan? Because QR codes use Reed-Solomon error correction, which mathematically reconstructs missing data. At Level H error correction, up to 30% of the code can be obscured. A logo placed over the centre typically covers less than that, so the decoder reconstructs the hidden data and the scan succeeds.
  2. 2.Is there a limit to how much data a QR code can hold? Yes. A single QR code can hold a maximum of around 3,000 alphanumeric characters or about 7,000 numeric digits at the highest version. For most use cases this is far more than needed. Very long data produces a dense, complex code that is harder to scan reliably, so keeping the payload short produces a more robust code.
  3. 3.Do QR codes expire? No. A QR code is just an image encoding a string. The code itself does not expire. However, if the code points to a URL, the destination page can be taken offline, which effectively breaks the code from the user's perspective. This is why using a redirect URL (one you control) rather than linking directly is good practice for long-lived print materials.
  4. 4.Can a QR code be scanned from a screen? Yes. Modern smartphone cameras scan QR codes from screens reliably. The considerations are the same as for print: adequate size, sufficient contrast, and a clear quiet zone.
  5. 5.What is the difference between a static and a dynamic QR code? A static QR code has the destination permanently encoded in the image. Changing the destination requires generating and reprinting a new code. A dynamic QR code encodes a short redirect URL: scanning sends the user to a redirect service, which forwards them to the actual destination. This allows the destination to be changed without reprinting the code. AlteredIdea generates static QR codes, which are suitable for the vast majority of use cases.

AlteredIdea's QR Code Generator creates codes for URLs, text, Wi-Fi, contact cards, and more. Choose error correction level, download as PNG or SVG, and your code is ready for print or digital use. No account needed.

S

Sam Holloway

Sam is a technical writer and developer who has spent over a decade building web tools and writing about software, security, and the web platform. He focuses on making complex topics genuinely useful for working developers and non-technical users alike.

Try it yourself

QR Code Generator

Free, browser-based: your files never leave your device.

Open tool