Skip to content
ForgePlug — Logo
All guides
Barcodeqr-codebarcodescanning

QR Codes Explained: How They Work and How to Make One

Those square patterns you scan with your phone are tiny data carriers. Learn how QR codes encode information and how to generate your own.

ForgePlug TeamJuly 8, 20265 min read

A QR code is a two-dimensional barcode: a square grid of black and white modules that any smartphone camera can decode in a fraction of a second. You've scanned them on restaurant menus, payment terminals, product packaging, and posters — and generating your own is a genuinely useful skill for marketers, event organizers, and developers.

How a QR code stores data

Unlike a linear barcode, a QR code stores data in two dimensions. Three distinctive corner squares (the finder patterns) tell the scanner where the code is and how it's oriented. The rest of the grid encodes the payload as a sequence of modules, along with error-correction data that lets the scanner reconstruct the message even if part of the code is damaged or covered.

  • URLs — the most common use: scan, open a website.
  • Wi-Fi credentials — scan to join a network without typing the password.
  • vCard contacts — scan to save someone's details instantly.
  • Payments and UPI/QR — point-of-sale and person-to-person transfers.
  • App links, locations, calendar events, and plain text.

Error correction is your friend

Higher error-correction levels let a QR code survive logos, stickers, and damage — at the cost of a denser pattern. If you plan to put a logo in the middle of your code, choose a higher level.

ForgePlug's QR Code Generator covers 11 content types — URLs, plain text, email, SMS, WiFi login, vCard, GPS, WhatsApp, calendar events, and more — with size, color, and error-correction controls, all rendered locally in your browser. When you need to read a code, the QR Scanner detects not just URLs but email addresses, phone numbers, WiFi credentials, and calendar events, and offers the right action for each.

Make your own QR code

Pick a content type, customize colors and error correction, and download a crisp PNG or SVG — generated entirely on your device.

Open QR Code Generator

Size, capacity, and why your code got denser

QR codes come in 40 versions, which describe the grid size rather than a software release. Version 1 is 21×21 modules; version 40 is 177×177. The generator picks the smallest version that fits your data at the error-correction level you chose, which is why adding a few characters can suddenly make the pattern noticeably denser — you crossed a threshold and the code stepped up a version.

Capacity depends on what you encode. The format has separate modes for numeric, alphanumeric, and arbitrary bytes, and they are not equally efficient. Alphanumeric mode covers digits, uppercase letters, and a handful of symbols, and packs them more tightly than byte mode. Lowercase letters force byte mode. That is why a long URL with mixed case and query parameters produces a far denser code than a short uppercase one — and a practical reason to encode a short link rather than a tracking-laden URL when the code will be printed small.

Error correction: the trade-off nobody explains

There are four levels — L, M, Q, and H — recovering roughly 7%, 15%, 25%, and 30% of the code respectively. The redundancy is what lets a code survive a scuff, a fold, or a logo placed over the centre. But it is not free: higher correction means more data to store, which means a denser grid at the same physical size, which means each module is smaller and harder for a camera to resolve.

The practical consequence is that maximum error correction is not automatically the safest choice. For a small printed code, level H can make modules so fine that scanning gets less reliable, not more. Use H when you genuinely need it — a logo overlay, or a label that will get handled and scuffed — and M for most other things.

Why codes fail in the real world

The most common cause is a missing quiet zone: the plain margin around the code, specified as four modules wide. Designers routinely crop it away or butt the code against artwork, and scanners then struggle to find the code's boundary. The white space is part of the code, not padding around it.

Second is inverted contrast. The specification assumes dark modules on a light background. Light-on-dark codes look striking and fail on a meaningful share of scanners, because many decoders do not attempt an inverted read. Low contrast causes the same problem more subtly — a mid-grey code on a coloured background can scan under bright light and fail in a dim restaurant.

Third is physical size. A workable rule of thumb is that a code should be about a tenth of the intended scanning distance: readable at arm's length means roughly 2–3 cm, while a poster meant to be scanned from three metres needs around 30 cm. Testing on your monitor tells you almost nothing about a printed code at real size and distance.

Static versus dynamic — decide before you print

A QR code cannot be edited after printing. If it encodes a destination directly, that destination is permanent. The standard fix is to encode a URL on a domain you control and redirect from there, so you can change where it leads without reprinting anything. For a restaurant menu, an event page, or a payment link on a physical card, that indirection is worth setting up before the print run — not after the URL changes.

You cannot see where a QR code goes before you scan it

That property makes QR codes a convenient phishing vector — codes stuck over legitimate ones on parking meters and payment terminals are a documented problem. Check the URL your phone previews before opening it, and be wary of codes on stickers that look applied rather than printed.

Privacy note

QR codes often encode private details — WiFi passwords, personal contacts, payment links. Generate and scan them locally: when the tool runs in your browser, nothing you encode is uploaded, stored, or tracked.

Try the tool

Put this guide into practice with the free tool it's about.