专家审核更新于2025年design
design
8 min readFebruary 6, 2025Updated Apr 17, 2025

二维码最佳实践:设计、对比度和布局

制作每次都能可靠扫描的二维码。了解印刷和数字二维码的对比度、尺寸、静区、纠错、徽标和位置等知识。

二维码无处不在——餐厅菜单、产品包装、名片、活动门票和营销活动中随处可见。但令人惊讶的是,很多二维码都无法稳定扫描。本指南将介绍确保二维码在不同设备、距离和光照条件下都能稳定工作的技术和设计因素。

Key Takeaways

  • 1
    保持高对比度(70%以上)——黑底白字最可靠
  • 2
    根据扫描距离选择合适的尺寸编码(每米 10 毫米是一个不错的规则)。
  • 3
    四周至少保持 4 个模块的安静区域

1可扫描二维码的构成

A QR (Quick Response) code encodes data in a 2D pattern of dark and light modules. Scanners rely on specific elements to read the code correctly.
Essential QR code components
ElementPurposeRequirement
Finder patternsThree large squares at cornersMust be clearly visible and high contrast
Alignment patternsSmaller squares for perspective correctionEssential for larger codes
Timing patternsAlternating modules between findersHelps determine module size
Quiet zoneClear margin around codeMinimum 4 modules on all sides
Data modulesEncoded contentMust not be obscured or distorted
The finder patterns (the three big squares) are how scanners orient the QR code. Never obscure these—even with a logo.

2Contrast, Size, and Quiet Zone

These three factors cause most QR scanning failures. Get them right and your codes will work reliably.
  • **Contrast ratio** – Dark modules on light background. Aim for 70%+ contrast ratio (black on white is best).
  • **Inverted codes** – Light on dark works but scans slightly slower. Avoid very dark backgrounds.
  • **Avoid patterns** – Don't place QR codes on textured, patterned, or glossy surfaces.
  • **Color QR codes** – Can work, but darker "dark" modules and lighter "light" modules. Avoid red/green (colorblind users).
QR code sizing guide
Scanning DistanceMinimum SizeUse Case
Up to 30cm (1ft)2cm × 2cmBusiness cards, product labels
30cm–1m (1-3ft)3-4cm × 3-4cmMenus, flyers, packaging
1-3m (3-10ft)5-10cm × 5-10cmPosters, window displays
3-10m (10-30ft)15-30cm × 15-30cmBillboards, banners

The Quiet Zone

The quiet zone is the blank margin around your QR code. Without it, scanners can't determine where the code ends. Keep at least 4 modules (the small squares) of clear space on all sides. More is better.

3Error Correction Levels

QR codes include redundant data so they can be read even when partially damaged. Higher error correction allows for more damage—or lets you add a logo—but creates more complex (denser) codes.
Feature
L (Low) – 7%
Minimal redundancy. Simplest code, smallest size, but fails if damaged.
M (Medium) – 15%
Default for most generators. Good balance of size and reliability.
Q (Quartile) – 25%
Recommended for print. Handles wear and tear well.
H (High) – 30%
Maximum redundancy. Best for logos but creates denser codes.
Recovery Rate7%15%25%30%
Best Used ForClean environmentsGeneral usePrint materialsIndustrial/outdoor
Logo SupportNot recommendedSmall logos possibleSafe for centered logosBest for logos
Use Q or H level when adding a logo. The logo should cover no more than 10-20% of the code area, centered, and never touch the finder patterns.

在二维码中添加徽标

Branded QR codes with logos look professional but require careful implementation to remain scannable.

Safe Logo Integration

1

Use high error correction

Set error correction to Q (25%) or H (30%) before generating the code.

2

Size logo appropriately

Keep logo to 10-15% of total QR area (20% max with H level).

3

Center the logo

Always place logo dead center. Never near edges or finder patterns.

4

Add a clear border

Put a small white or light border around the logo so it doesn't blend into modules.

5

Test extensively

Scan with 5+ different devices in varied lighting before finalizing.

Common Logo Mistakes

Don't use complex multi-color logos. Don't stretch or rotate the QR code. Don't place logo over finder patterns (the big squares). Don't use transparent logo backgrounds on dark modules.

5URL结构:简洁型与可追踪型

The data you encode affects QR code density. Shorter URLs create simpler, more scannable codes. But marketing often requires tracking parameters.
URL strategies for QR codes
ApproachExampleProsCons
Clean URLexample.com/menuSimple QR, trustworthy look, fast scanNo tracking
UTM parametersexample.com/menu?utm_source=poster&utm_medium=qrFull analyticsComplex QR, long URL visible
Short linkexm.pl/menu-posterSimple QR, tracking behind redirectDepends on shortener uptime
Dynamic QRqr.example.com/abc123Can change destination, full trackingRequires QR management service
For print materials, consider a custom short domain (e.g., your-brand.link) with redirects. You get clean QR codes plus full tracking, and you control the redirect if the destination changes.

Create Your QR Code

Generate high-quality QR codes with custom colors, logos, and error correction levels.

Open QR Generator

6分班和测试

Even a perfectly designed QR code fails if placed poorly. Consider the scanning environment.
  • **Surface material** – Matte surfaces work best. Glossy creates reflections; textured obscures modules.
  • **Lighting** – Ensure adequate light. Avoid direct sunlight causing glare or deep shadows.
  • **Viewing angle** – Place at eye level for posters. Avoid extreme angles (tables, floors).
  • **Movement** – Don't place on moving objects or where people can't pause to scan.
  • **Environment** – Protect outdoor codes from rain, fading, and wear.

Pre-Launch Testing Checklist

1

Test the print proof

Don't just test on screen—scan the actual printed proof.

2

Use multiple devices

Test with at least 3-5 different phones (iOS, Android, various ages).

3

Test at target distance

Scan from the distance users will actually be at.

4

Test in expected lighting

If it's for outdoor use, test outdoors.

5

Verify the destination

Make sure the URL loads correctly on mobile and the page is mobile-optimized.

Digital vs Print

For screen-displayed QR codes (presentations, digital signage), ensure the display doesn't refresh or flicker during scanning. Static screens work best.

常见问题解答

二维码的最小尺寸是多少?
对于手持扫描(手机距离屏幕20-30厘米),最小尺寸为2厘米×2厘米。扫描距离每增加1米,尺寸需增加约1厘米。例如,如果广告牌的扫描距离为5米,则其尺寸至少应为7-8厘米。
我可以使用彩色二维码吗?
是的,但要保持高对比度。深色模块应该比浅色模块暗得多。避免使用对色盲用户来说难以辨认的颜色组合(例如红/绿)。黑底白字仍然是最可靠的选择。
如果零件损坏,我的二维码还能用吗?
这取决于纠错级别。L 级(7%)即使是轻微的损坏也会导致扫描失败。H 级(30%)允许高达 30% 的纸张损坏或被遮盖(包括被徽标遮盖),仍然可以扫描。Q 级(25%)是打印的理想默认值。
二维码会过期吗?
静态二维码(直接包含网址)永不过期——它们只是编码数据。而使用重定向服务的动态二维码,如果服务停止运行或您停止付费,则可能会过期。
如何追踪二维码扫描情况?
在网址中使用 UTM 参数以进行 Google Analytics(分析)跟踪,或者使用带有分析功能的网址缩短服务。对于高级跟踪,请使用动态二维码服务,该服务会记录扫描信息以及设备信息和位置。