The Complete QR Code Guide: How They Work, Batch Generation, and Artistic QR Codes

工具教程

QR Codes Are Everywhere—But Do You Actually Know How to Make One?

Ordering food by scan, adding WeChat, joining Wi-Fi, issuing invoices, making payments—QR codes have seeped into daily life. But the moment it's "I need to generate a code," a lot of people just search for a random website, and the result is either ugly, or it won't scan even when you hold your phone right up to it, and there's a nagging worry: will this thing send what I typed off somewhere?

In the years we've run the QR tools in our library, the most common question isn't "how do I generate one" but "why won't the code I made scan." This article breaks down the internals so the codes you make are both good-looking and guaranteed to scan.

If you just want a plain code fast, go to the QR code generator; but to understand the principles and avoid crashes, the following is worth reading.


What a QR Code Actually Is: An Underrated Engineering Marvel

The QR Code (Quick Response) was invented in 1994 by Denso Wave (a Toyota subsidiary) to track automotive parts. Its standout feature is high-speed reading—unlike a 1D barcode, a phone camera can parse it instantly from any angle, even partially damaged.

Those little squares are "modules," and the whole image is black-and-white modules. The key structures:

Structure Location Function
Finder pattern Big squares in three corners Camera locates position, size, angle
Alignment pattern Small square near bottom-right Corrects distortion on large/curved codes
Timing pattern One horizontal + one vertical line Determines the module coordinate grid
Format information Beside finder patterns Stores error-correction level and mask
Data area Large middle region The actually encoded content
Quiet Zone Whitespace around edges Helps camera find the boundaries

Key numbers:

  • Versions 1–40: determine capacity. Version 1 is 21×21 modules; each version adds 4 modules per side; version 40 is 177×177. Higher version = more data, denser code.
  • Encoding modes: numeric (0–9) is most space-efficient, then alphanumeric (A–Z, 0–9, few symbols), then byte (Chinese, emoji, binary—most expensive).
  • Error correction: the smartest part—using Reed-Solomon, even if smudged or partly obscured, the data can be reconstructed.

Trivia: the foundational QR patent was made public and free long ago; Denso Wave voluntarily gave up royalties, a big reason it spread globally.


Reed-Solomon Error Correction: Why It Still Scans When Dirty

Simply put, Reed-Solomon "appends a block of redundant check data" after the original. Say the original is 100 modules and level H adds ~30 modules of redundancy. When the phone scans, even if some of those 30 are covered by coffee stains, the algorithm mathematically reconstructs the whole content from what remains.

That's why "partially covered" codes sometimes still scan and sometimes don't—it depends on whether the error-correction level was set high enough.


The Four Things That Actually Decide "Will It Scan"

Many blame the phone, but the landmine was usually planted at generation time.

1. Error-correction level L / M / Q / H

Level Recoverable area Module density Use
L ~7% Sparsest Clean print, untouched environment
M ~15% Moderate Most scenarios (default recommended)
Q ~25% Denser Outdoors, easily dirty places
H ~30% Densest Logo overlay, long-term outdoor

Rule of thumb: M for daily use. If you put a logo in the center, go to at least Q; for long-term outdoor or artistic treatment, use H.

2. Quiet Zone

The code must have whitespace around it—standard is at least 4 modules wide. People paste codes to poster edges or into narrow borders, the camera can't find the boundary, and it never scans. Whitespace matters more than you think—keep it generous.

3. Contrast

Dark foreground, light background—that's the law. Light-gray background with white text, or a low-contrast brand color, and the phone struggles under slight glare. Safest is black modules on white.

4. How Much You Stuff In

A URL of a few dozen characters is fine. If you cram a whole self-intro (full vCard), the version spikes, the modules get so dense a small screen can't pull back far enough to scan. Shorter content = steadier code. Use a short link when you can.

5. Print Size vs Scan Distance

An often-ignored relation: minimum print edge ≈ scan distance ÷ 10. If users scan from 30cm away, the code should be at least 3cm square; an outdoor billboard scanned from 2m needs 20cm+. Modules too small, and no error correction can save it.


Different Uses, Different Formats

  • URL: just https://example.com, no extra text. Shorten if possible.

  • Plain text: a slogan, a note—keep it short.

  • Wi-Fi: format is WIFI:S:network;T:WPA;P:password;;. Easy to typo manually (special chars need escaping), so use the Wi-Fi QR tool—guests scan and connect without you dictating the password.

  • vCard: good for résumés, email signatures. Full example:

    BEGIN:VCARD
    VERSION:3.0
    N:Zhang;San;;;
    FN:Zhang San
    TEL;TYPE=CELL:13800000000
    EMAIL:zhangsan@example.com
    ORG:Some Company
    END:VCARD
    

    Don't overdo fields or the version spikes.

  • Email / SMS: mailto:someone@example.com?subject=Hi and SMSTO:13800000000:content jump straight to the app.

  • Geo: geo:39.9042,116.4074 opens the map app at that point.


Batch Generation: When You Need a Hundred

Some scenarios aren't one or two:

  • Event tickets, one code per attendee
  • Product traceability, one code per batch
  • Restaurant table numbers, conference table cards, asset tags

Clicking through a web page typing each one by hand—you'll want to smash the keyboard by the third. Our tool takes a batch of content at once, exports images or a ZIP, done in minutes. The single QR tool is for on-the-fly; use its batch mode for volume—paste a list (one link/text per line) and export all at once.

Practice: 100 traceability codes for products

Prepare CSV: one product link per line
  → paste into batch mode
  → choose level Q (warehouse gets dirty)
  → uniform 300×300, export ZIP
  → straight to the print shop

Artistic QR Codes: Pretty but Don't Sacrifice Scannability

A dead black square on brand material makes designers wince. That's where the artistic QR tool helps: dot style, gradient colors, center logo, custom foreground/background.

But there's a line between "artistic" and "scannable," and crossing it crashes:

  • Don't cover the three finder corners: those big squares are how the camera locates the code; cover one and it likely won't scan. Put the logo in the center, away from the corners.
  • Keep contrast: however nice the gradient, foreground and background must separate.
  • Raise the error-correction level: artistic treatment itself interferes with recognition; bump to Q or H.
  • No light-colored modules: light-gray modules on white basically won't scan—keep a dark foreground.

For developers: generate with code

Python's qrcode library controls most parameters:

import qrcode

qr = qrcode.QRCode(
    version=None,            # auto-pick smallest version
    error_correction=qrcode.constants.ERROR_CORRECT_H,  # high EC, room for logo
    box_size=10,
    border=4,               # quiet zone, at least 4
)
qr.add_data("https://example.com")
qr.make(fit=True)

img = qr.make_image(fill_color="black", back_color="white")
img.save("qrcode.png")

On the JS side, the qrcode library runs in browser/Node; our QR tool uses similar logic under the hood, except it's fully local with no upload.


The Reverse: You Have a Code Image, Want the Content

Not just generating—sometimes you get a QR screenshot and want to know where it points. Use the QR decode tool to upload the image and parse the text or link, no need to scan with your phone against the screen. It also runs locally via camera/recognition algorithms; the image never leaves the browser.


Static vs Dynamic Codes

An easily-confused concept:

Type Principle Change content? Track scans?
Static Content encoded directly in the image ❌ regenerate to change
Dynamic Image stores only a short link that redirects to a backend-configured real address ✅ change anytime ✅ trackable

Our QR tool generates static codes—no backend, no service dependency, permanent and fully private. If you need "change content and the old code still works" or scan analytics, that's a different server-backed solution, outside the local-tool scope.


Privacy

Generating a QR code is just encoding text into an image; no server is involved. Our QR tool computes everything locally in the browser; the URLs, passwords, and contact info you enter are never uploaded. Especially for Wi-Fi codes with plaintext passwords, local generation is the only sane choice—you definitely don't want your home Wi-Fi password sent to some stranger's server to get a code.


Common Mistakes

Mistake Consequence Fix
Code pasted to edge, no quiet zone Won't scan ≥4 modules whitespace around
Light bg + light text Slow or fails Dark fg, light bg
Logo over finder corner Completely unscannable Logo in center, avoid corners
Cramming a long paragraph Too dense, small screens fail Short link, concise content
Low EC + overlay Dies at first smudge Use Q/H when overlaying
Printed too small Fails at distance Edge ≥ scan distance ÷ 10

FAQ

Is higher error correction always better? No. Higher = denser, and at the same content the code is larger—only worth it in print. M is enough daily; Q/H only when overlaying or outdoors.

Do artistic QR codes scan poorly? As long as you keep the finder corners, contrast, and enough EC, phones scan them instantly. Crashes only happen when those three are skimped.

How much can a QR hold? Theoretical max ~7089 digits / 4296 letters / 2953 bytes (version 40 + L). But honestly, that much is basically unscannable; keep it under a few hundred characters in practice.

Do generated codes expire? No. Static QR is a static image with no service dependency—valid forever, unless the printed paper breaks.

Can it be circular/irregular and still scan? Dot style yes (module shape changed, finder patterns kept). But "irregular" shapes that cut corners or break finder patterns basically won't scan. Artistic treatment must keep the three bottom lines.


One-Line Decision

Need a QR code?
├── Plain link / text → /encode/qr
├── Guest Wi-Fi → /encode/wifi-qr
├── Brand feel, pretty → /utils/art-qr (EC to Q+, logo away from corners)
├── A hundred of them → /encode/qr batch mode
└── Have a code image to read → /encode/qr-decode

Next time you need a code, decide the use first, pick the tool by the branch above, and deliver a batch of pretty, guaranteed-scannable codes in ten minutes. For handling the exported code as a transparent PNG for posters, see the image format conversion guide.

Try these browser-local tools — no sign-up required →

#二维码#QR Code#批量生成#艺术二维码#Wi-Fi二维码#隐私