What Is a QR Code? Definition, Anatomy, and Real Examples

Learn what a QR code is, what it can store, how its patterns work, and how to publish one that scans reliably in print and on screens.

Rehan Haider
By Rehan Haider
April 15, 2026
What Is a QR Code? Definition, Anatomy, and Real Examples

A QR codeA 2D matrix barcode that encodes data in a square grid of black and white modules. Read more → (short for Quick Response) is a two-dimensional barcode that stores data in a grid of dark and light squares called modulesA single black or white square in the QR grid. The number of modules per side scales with the QR versionThe size of a QR code, numbered 1 (21×21 modules) through 40 (177×177). Higher versions store more data but require more printed space. Read more →, from 21×21 modules for version 1 up to 177×177 for version 40. Read more →. Point a phone camera at one and the device decodes the pattern, then performs an action: opening a website, joining a Wi-Fi network, dialing a number, or drafting an email. The whole flow takes about a second when the code is well made.

QR codes spread because they solve a tedious problem cleanly. They scan from multiple angles, recover when part of the pattern is damaged, and require nothing more than the camera app already on every modern phone. You see them on menus, posters, packaging, business cards, event tickets, payment terminals, kiosks, and the back of shipping boxes.

This guide covers what a QR code actually is, what shapes inside it do what, and how to publish one that works the first time someone scans it.

What a QR code can contain

In day-to-day use, a QR code usually encodes one of these payload types:

  • A website URL. By far the most common. Sends the scanner to a landing page, menu, form, or product detail.
  • Wi-Fi credentials. A specially formatted string with the network name, password, and encryption type. The phone joins automatically.
  • A phone number. Triggers the dial app pre-filled with the number.
  • An SMS template. Opens the messaging app with the recipient and body already filled in.
  • An email draft. A mailto: payload with the recipient, subject line, and body pre-populated.
  • Plain text. Less useful for business because the user still needs a follow-up step, but fine for short notes.

Here’s what each looks like as raw data inside the code:

https://fast-qr.app/qr-code-for
WIFI:T:WPA;S:MyGuestNetwork;P:correct-horse-battery-staple;H:false;;
tel:+14155552671
sms:+14155552671?body=Hi%20I%20want%20to%20book%20a%20table%20for%202
mailto:support@example.com?subject=Order%20help&body=My%20order%20number%20is%20...

If you need a code right now, the URL-to-PNG generator downloads a print-ready file in seconds. For design work that scales without blurring, use the SVG version. Sharing a guest network? Generate one with the Wi-Fi-to-PNG generator and skip the awkward password dictation.

QR code anatomy

A QR code is not random squares. The pattern has structure so a scanner can find it, square it up, and decode it in one camera frame. Once you know what each part does, design choices that break scanning become obvious.

Finder patterns

The three large nested squares in three corners are finder patternsThe three large squares in the corners (top-left, top-right, bottom-left) of every QR code. Scanners use them to detect a QR in the camera frame, lock onto it, and determine its orientation. Read more →. They do most of the heavy lifting before any data gets read. A camera looking at a busy scene uses them to:

  • Detect that something in the frame is a QR code at all.
  • Establish the code’s orientation, even if it’s rotated 90, 180, or 270 degrees.
  • Estimate the module grid spacing so the scanner knows where each cell sits.

Three corners (not four) is intentional. The asymmetry tells the decoder which way is up.

Alignment patterns

Larger QR codes include one or more smaller nested squares, typically near the bottom-right. These alignment patternsSmaller square patterns scattered through QR codes from version 2 onward. They help scanners correct for perspective distortion when the code is photographed at an angle, on curved surfaces, or with a wide-angle lens. Read more → help the scanner correct for:

  • Perspective distortion when the code is viewed at an angle, like a menu on a tilted table.
  • Curved or warped surfaces such as bottles, takeaway cups, or flexible packaging.
  • Print variation from low-resolution printers or ink bleed.

The smallest QR codes (Version 1) skip alignment patterns because the grid is small enough not to need them.

Timing patterns

Between the finder patterns run thin lines of alternating dark and light modules. These timing patternsA row and column of alternating black/white modules running between the finder patterns. Scanners use them to determine the exact size of each module after rough detection, locking the read into the QR's grid. Read more → let the scanner measure exactly how wide one module is in the captured image, so it samples each cell at the right pixel coordinates. Without timing patterns, sampling drift would compound across a large grid.

The quiet zone

A QR code needs blank padding around it called the quiet zoneThe unprinted margin of at least four modules' width that must surround every QR code. Read more →. This is not visual breathing room. It’s a functional requirement.

The quiet zone keeps the scanner from confusing nearby text, borders, or graphics as part of the pattern. Specs call for at least four modules of blank space on every side. Crowding the margin is the single most common reason printed codes fail in the real world. If a QR code sits inside a colored frame or wedged against body copy with no padding, expect customer complaints. See the glossary entry for quiet zone for the exact measurements.

Data and error correction modules

Everything else in the grid carries either your payload or redundancy data. Reed-Solomon error correctionMathematical redundancy built into every QR code that lets it scan correctly even if part of the matrix is damaged, dirty, smudged, or covered (for example by a logo). Read more → lets the code decode even if part of it is missing or covered. That’s how a small logo in the center can sit on top of data modules without breaking the scan, and how a scuffed corner on a sticker still works.

For more on how that recovery actually works, see QR code error correction explained.

QR versions and why size matters

QR codes come in versions numbered 1 through 40. Each step up adds modules to the grid, raising capacity but shrinking individual modules at any fixed printed size. A Version 1 code is 21x21 modules. A Version 40 code is 177x177.

Higher capacity sounds appealing until you remember that smaller modules at the same physical size are harder for cameras to resolve under poor lighting, motion blur, or long scan distance. A poster QR with thousands of tiny modules might look fine on your monitor and fail on the wall.

The reliable move: keep your payload short so the encoder picks a low version. A clean 30-character URL fits comfortably at Version 2 or 3. A 200-character URL with tracking parameters can push you to Version 7 or higher and noticeably tighten the grid. If the URL is bloated with query strings, shorten the destination or route through a redirect.

For sizing rules by use case, see the size and print guidelines.

Static vs dynamic codes

Most QR codes you generate are static. The destination is encoded directly into the pattern, so once printed, that pattern always points to the same place. Cheap, private, and they last forever, but if the destination URL changes, every printed code becomes useless.

Dynamic QR codesA QR code that points to a short redirect URL controlled by a service. Read more → encode a redirect URL that you (or a vendor) own. The redirect can be repointed anytime without touching the printed code. Useful for long-running campaigns, but it adds an operational dependency: if the redirect domain lapses or the vendor’s service shuts down, every code breaks. Vendor short links are especially risky for materials with a multi-year life.

For a deeper comparison, including when each makes sense, see static vs dynamic QR codes.

Before you print

A few sanity checks save expensive reprints later.

Lock the destination. Temporary campaign pages disappear; if the URL changes after print, every code is dead. If flexibility matters, route through a redirect on a domain you control.

Pick high contrast. Dark modules on a light background scan faster than the reverse, especially in the dim restaurant or warehouse lighting where most QR codes actually get scanned. Avoid pale gray on white, no matter how stylish it looks in the mockup.

Preserve the quiet zone. Leave at least four modules of blank space on every side. If your design crowds the code, redesign the layout, not the code.

Test on multiple devices. Try iPhone, Android, and at least one older phone. Scan from a typical user distance, not from six inches away.

Match the file format to the medium. Use SVG when the code lives in design software or scales for large-format print. Use PNG for digital displays, slide decks, and email. The URL-to-SVG generator and URL-to-PNG generator cover both.

For full rollout playbooks by scenario, see the use-case guides: guest Wi-Fi, restaurant menus, retail packaging, and customer reviews are good starting points.

Sources

Ready to make a QR code that scans reliably?

Build your QR code, test it on real devices, and download the right file format for your channel.