21K Tools

What those black and white squares are actually doing

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.

Why some QR codes are bigger than others

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.

Practical implication: the shorter your URL, the smaller and simpler the resulting QR code. A short link (like one generated by the URL shortener on this site) produces a smaller, easier-to-scan code than a long URL with UTM parameters. For print campaigns especially, shortening the destination URL before generating the QR code is worth doing.

Error correction — why you can put a logo in the middle and it still scans

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.

The logo rule: if you add a logo, set error correction to Q or H before generating. A logo covering 15–20% of the code plus natural scan noise plus print imperfections can easily exceed the recovery capacity of level M. Level H gives you 30% headroom. The trade-off is that higher error correction levels require more modules, so the code is slightly more complex — but in practice the difference is not visible to the human eye.

What damages a QR code

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.

Static vs dynamic — the one decision that matters most for print

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
One edge case for static: WiFi QR codes, UPI payment codes, and vCards should always be static. These encode structured data directly — there's no destination URL to redirect. Dynamic makes sense specifically when you're encoding a web address and you care about flexibility or analytics.

The 11 QR content types — what each one actually encodes

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
Email 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
WhatsApp 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
Static type rule: WiFi, UPI, vCard, email, phone, SMS, location, and plain text should always be static QR codes. They encode structured data directly — there's no web URL involved and nothing to redirect. Dynamic codes only make sense for Website URL, WhatsApp, and File Upload types where pointing to a web address is the whole point.

Design decisions that actually affect whether your code scans

Most QR code design advice focuses on aesthetics. The things that actually matter for reliability are more specific — and more interesting.

The quiet zone people always crop out

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.

Contrast is a requirement, not a preference

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.

Size for the expected scanning distance

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.

On gradient colours: gradients work visually but reduce scanner reliability slightly because modules at the lighter end of the gradient have lower contrast against a white background. If you use a gradient, test the generated code on three different phones before printing. Testing on the same phone you generated it on gives a false sense of security — camera sensors and scanner algorithms vary significantly between manufacturers.

Logos and the 30% ceiling

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.

QR Code Suite

Generate · Scan · Profile Cards · Bulk Generate · Templates — all free, no sign-up

Create QR Code

Generating your QR code…

URL
Contact
Email
Phone
SMS
WiFi
UPI
Location
Text
WhatsApp
File
Include https:// for the redirect to work correctly
Right-click any location in Google Maps to copy coordinates.

Drop file here or click to browse

Any file type up to 10MB
Design
Enable Gradient
Square
Dots
Rounded
Classy
Cl. Round
X-Round
None
Square
Rounded
Circle
Badge
Scan Me
Modern
Neon
Minimal
Add Logo to Centre
Dynamic QR (edit URL later, track scans)

Your QR code is ready

Generated QR Code
Analytics Code
Analytics Dashboard View Analytics
Created

Scan QR Code

Use your camera or upload an image containing a QR code.

OR UPLOAD IMAGE

Scanned successfully

Digital Profile Card

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.

Profile card created

Profile QR
Profile Page View Profile
Analytics View Analytics

Bulk QR Generation

Generate many QR codes at once. Add items manually or upload a CSV (columns: title, url, description).

Upload CSV instead

Generated 0 QR codes

Templates

Click any template to apply its colour and style settings to the generator.

Professional Blue
Clean corporate design
Food & Restaurant
Warm appetising style
Event Blue
Tickets and events
Green Retail
Fresh shopping style
Healthcare Pink
Warm health design
Education Gradient
Modern learning
Tech Dark
Modern tech look
Travel Pastel
Beautiful journey theme
Fitness Orange
Energetic workout style
Real Estate
Property listing style

Things people actually want to know

Usually contrast. The scanner's camera needs to distinguish between dark and light modules clearly. If you've used light colours on a light background, or similar values on both sides, the camera can't find the module boundaries. The other common cause is printing a QR code too small — below about 2cm square, most smartphone cameras struggle. Size matters more than most people expect.
Only if it's a dynamic QR code. Dynamic codes encode a short redirect URL — the final destination is stored on the server and can be changed at any time through your analytics dashboard. Static codes have the destination burned into the pattern itself; change the destination and you need a completely new code. Dynamic is on by default in the generator above.
It can, if you don't set the right error correction level. A logo covering 15–20% of the code's surface destroys that portion of the data modules. Error correction at level Q or H can recover up to 25–30% of missing data, which covers the logo plus reasonable real-world scan noise. At level M (15%), a 20% logo leaves almost no margin. Always set error correction to Q or H before generating a code with a logo.
2cm × 2cm is the practical minimum for a smartphone held 20–30cm away. For every extra metre of expected scan distance, add roughly 1cm to each side. A QR code on a conference poster meant to be scanned from 1 metre away should be at least 3cm × 3cm. A billboard scanned from 5 metres needs to be much larger — the proportion matters more than an absolute number.
The UPI QR code follows the standard UPI deep-link format (upi://pay?pa=…). Any UPI-compliant app can read it — Google Pay, PhonePe, Paytm, BHIM, and all bank UPI apps. Leave the amount field blank if you want the payer to enter the amount themselves; fill it in if you want to request a fixed sum. The QR code for UPI should always be static — there's no URL to redirect.
No. Generate as many as you want — single codes, bulk batches, profile cards. Everything is free with no account required and no watermarks on output images.
Go to the Bulk tab, toggle "Upload CSV instead", and upload a CSV file with three columns: title, url, description — with that exact header row. Each subsequent row becomes one QR code. The tool generates all codes in the batch and displays them in a grid where you can download individually or get all of them in a single ZIP file. There's no hard limit on batch size, but very large batches take longer to generate and download.
A Profile Card is a hosted webpage that works as your digital business card — name, title, contact details, social links, bio, and photo on one page. Fill in the Profile Card tab, click generate, and we host the page at a unique URL indefinitely. The QR code links to that page. Anyone who scans it sees your full profile and can tap to call, email, or open your social links directly. The page stays live as long as the service runs.
Yes. In the Scanner tab, click "Upload QR Image" instead of starting the camera, and select any JPG, PNG, GIF, or WebP image containing a QR code. The decoder analyses the image locally in your browser using the jsQR library — the image is not sent to any server. If the code was generated with sufficient contrast and is not severely distorted, it decodes instantly.
Two common causes. First, check that the encryption type matches exactly — if your router uses WPA2 and you selected WEP, or vice versa, the join prompt either won't appear or will fail silently. Second, this feature requires the phone's built-in camera or native QR scanner — third-party scanner apps often decode the text but don't trigger the join prompt because they don't have the OS permission to modify network settings. Try scanning with the default camera app.
Your analytics are accessible only through the unique analytics URL shown immediately after you generate the code. That URL contains a randomly generated secret code — it's not guessable and not listed anywhere publicly. Anyone who has that exact URL can view the scan statistics, so treat it like a private link. The short redirect URL embedded in the QR code itself only forwards scans — it doesn't expose any analytics data.
Go to
Tool

Explore Our Tools

Discover our collection of powerful tools to make your work easier. Visit 21k.tools for all available tools and resources.

URL Shortener

Create short, shareable links instantly.

QR Tools

Generate and Scan QR codes smartly.

PDF Tools

Merge, split, and edit PDF files easily.

Unit Converter

convert units from one to another easily .

File Converter

Convert between multiple file formats.

Image Resizer

Resize and optimize images for any use.

Time Calculator

Calculate time in hours, minutes, and seconds

Age Calculator

Calculate age in years, months, and days.

Interest Calculator

Calculate simple and compound interest.

View All Tools