People treat QR codes like black boxes: you generate one, it works, or it doesn't. But there are real reasons why some codes scan in under a second and others fail entirely — contrast, size, error correction level, whether it's static or dynamic. Understanding those reasons takes about five minutes and will save you from printing 500 flyers with a QR code that doesn't work.
This page covers how QR codes actually encode data, what error correction does and why it matters when you add a logo, the difference between static and dynamic codes, and what "DPI" means for printed codes. Then the full toolkit lets you generate, scan, customise with logos and gradients, bulk-generate from CSV, and create digital profile cards — all free.
A QR code is a two-dimensional matrix — a grid of black and white squares called modules. Unlike a barcode which encodes data along one axis only, a QR code encodes data across both dimensions, which is why it can hold dramatically more information in a smaller physical space.
The three large squares in the corners are called finder patterns. They serve one purpose: telling the scanner where the code's boundaries are and which way it's oriented, regardless of the angle it's photographed at. You'll notice that QR codes scan from any rotation — upside down, tilted 45 degrees, reflected — and that's because the finder patterns allow the decoder to orient itself before reading any data.
Once the scanner has located the finder patterns, it reads the data modules row by row. Each module is either dark (1) or light (0), giving you a binary stream. That stream is then decoded according to the QR encoding mode — numeric (just digits, most efficient), alphanumeric (letters and numbers), byte mode (any character), or Kanji. The decoder figures out which mode was used from a small header at the start of the data.
QR codes come in versions 1 through 40. Version 1 is 21×21 modules and can hold about 41 numeric characters. Version 40 is 177×177 modules and can hold over 7,000 numeric characters. The more data you encode, the higher version is needed, and the more visually complex the code becomes. A URL like https://21k.tools fits comfortably in a small version. A vCard with a full address, email, phone, and website needs a higher version and more modules.
Every QR code contains redundant data. A portion of the modules don't encode your actual content — they encode error correction data derived from your content using Reed-Solomon codes, the same mathematics used in CDs and QR codes share with deep space communication protocols. If some modules are damaged, obscured, or incorrectly read, the decoder can reconstruct the missing data from the redundancy.
There are four error correction levels: L (low, 7% recovery), M (medium, 15%), Q (quartile, 25%), and H (high, 30%). At level H, up to 30% of the code's modules can be destroyed and it will still decode correctly. This is why placing a logo in the centre of a QR code works — you're deliberately obscuring a portion of the modules, and the error correction recovers the missing data.
Error correction matters most in the real world because QR codes get used in imperfect conditions. Printed codes get folded, scratched, and photographed in poor light. Stickers on packaging get partially peeled. Screen glare obscures portions of digital codes. Even at 7% error correction level, a clean code on a screen scans near-instantly. The higher levels are insurance against physical degradation.
One thing error correction cannot save you from: insufficient contrast. If your QR modules don't contrast clearly against the background — light purple dots on white, for example — the scanner's camera simply can't distinguish the module boundaries. No amount of error correction helps when the scanner can't see the modules at all. Dark modules on a light background is not a design preference, it's a technical requirement.
A static QR code encodes your destination directly into the code's modules. If you generate a code for https://yoursite.com/campaign-2024, that URL is burned into the pattern. Change the URL and you have a completely different code. Print 1,000 flyers and discover the URL is wrong, and you've wasted 1,000 flyers.
A dynamic QR code encodes a short redirect URL — something like https://21k.tools/q/abc123. That short URL is stored on the server, and points to your actual destination. Change the destination on the server and every code already printed now points to the new URL — the physical code hasn't changed at all.
| Feature | Static QR | Dynamic QR |
|---|---|---|
| Destination editable after print | No | Yes |
| Scan analytics (count, location, device) | No | Yes |
| Works offline (no server needed) | Yes | No — needs redirect server |
| Code complexity | Depends on URL length | Always short, always simple |
| Best for | WiFi, vCards, payments, text | Print campaigns, packaging, events |
A QR code is format-agnostic — it encodes a string of characters. But different types of content have agreed-upon string formats that apps know how to interpret automatically. When a scanner reads a string starting with WIFI:T:WPA;S:MyNetwork;P:pass123;; it knows to show a "join this network" prompt. When it reads BEGIN:VCARD it knows to offer to save a contact. These formats are standardised — not proprietary to any app.
| Type | What's encoded | What the scanner does |
|---|---|---|
| Website URL | Any valid web address starting with https:// | Opens in the default browser automatically |
| Contact (vCard) | Name, phone, email, company, address in vCard 3.0 format | Prompts to save as a new contact — works on Android and iOS |
| Recipient address, optional subject and body as a mailto: URI | Opens the mail app with fields pre-filled | |
| Phone | Phone number as a tel: URI with country code | Opens the phone dialler with the number ready to call |
| SMS | Phone number and optional pre-filled message as an sms: URI | Opens the SMS app with recipient and message ready |
| WiFi | SSID, password, encryption type, and hidden flag in WIFI: format | Prompts to join the network — no typing the password |
| UPI Payment | UPI ID, payee name, optional amount and note as a upi://pay URI | Opens GPay, PhonePe, Paytm, or any UPI app to complete payment |
| Location | Latitude and longitude as a geo: URI | Opens the maps app at that exact coordinate |
| Plain Text | Any character string up to 4,296 characters | Displays the decoded text directly — no special app action |
| Phone number and optional pre-filled message as a wa.me link | Opens WhatsApp and starts a chat with that contact | |
| File Upload | A hosted file URL — the file is uploaded to our server first | Opens or downloads the file in the browser |
Most QR code design advice focuses on aesthetics. The things that actually matter for reliability are more specific — and more interesting.
Every QR code standard requires a clear margin — called the quiet zone — of at least four module widths on all four sides. A module is one of those small squares. On a 300×300 pixel QR code with 29×29 modules, each module is about 10 pixels. Four modules is 40 pixels per side. That border looks like wasted white space, but it's how the scanner locates the code's edges before it starts reading.
The most common reason a professionally designed QR code fails is that a designer cropped the image tightly to remove that "empty" border. The scanner then can't find the finder patterns and gives up. If you're placing a QR code inside a design, preserve the quiet zone — or add it manually as padding.
Camera-based scanners convert the image to a binary (black/white) map before decoding. They do this by finding a threshold luminance value and classifying every pixel as either above or below it. If your dark modules are dark purple and your background is light purple, the camera may classify both as the same side of the threshold — and the code becomes invisible to the algorithm even though it's perfectly visible to your eye.
The practical rule: your module colour and background colour should have a luminance difference of at least 40%. Black on white is the gold standard. Dark colour on white works fine. Dark colour on a slightly lighter shade of the same hue is where things start to fail. Never reverse the contrast — light modules on dark backgrounds fail more often than they should because not all scanner apps handle inverted QR codes.
A QR code on a business card held 25cm from a phone needs to be at least 2.5cm × 2.5cm. That same code on a conference backdrop scanned from 2 metres needs to be at least 20cm × 20cm — the angular size needs to be roughly the same for the camera to resolve the modules. A rough rule: add 1cm per metre of expected scanning distance. Billboard QR codes fail not because they're designed wrong but because they're not sized for the distance.
The maximum logo size is roughly 30% of the QR code's total surface area, assuming you've set error correction to H (30% recovery). In practice, keep it at 20–25% to leave margin for real-world imperfections — slight printing misregistration, viewing angle, glare. A logo that touches the finder patterns (the three corner squares) will cause immediate failure because those patterns are not covered by error correction — they're required for the decoder to orient itself before it even looks at the data.
Generate · Scan · Profile Cards · Bulk Generate · Templates — all free, no sign-up
Generating your QR code…
Drop file here or click to browse
Any file type up to 10MBUse your camera or upload an image containing a QR code.
Create a hosted digital business card page and generate a QR code linking to it. Fill in as much or as little as you want.
Generate many QR codes at once. Add items manually or upload a CSV (columns: title, url, description).
Click any template to apply its colour and style settings to the generator.
Discover our collection of powerful tools to make your work easier. Visit 21k.tools for all available tools and resources.
Create short, shareable links instantly.
Generate and Scan QR codes smartly.
Merge, split, and edit PDF files easily.
convert units from one to another easily .
Convert between multiple file formats.
Resize and optimize images for any use.
Calculate time in hours, minutes, and seconds
Calculate age in years, months, and days.
Calculate simple and compound interest.