QR 码生成器 — 免费在线创建 QR 码
为 URL、纯文本、WiFi 网络、电子邮件地址、电话号码和短信消息生成 QR 码。可自定义颜色、纠错级别和尺寸,支持下载 PNG 或 SVG 格式,完全免费且无需注册。
QR Code Options
Enter content to generate a QR code
常见问题
什么是二维码?
QR(快速响应)码是一种二维矩阵条形码,以黑白方块的图案存储数据。1994年由电装波动公司发明,用于追踪汽车零部件,二维码可以编码网址、文本、WiFi凭据、联系信息等内容。它可以通过智能手机摄像头和专用扫描仪读取,是一种快速、无接触的信息共享方式。
什么是二维码纠错级别?
二维码使用Reed-Solomon纠错技术,即使局部损坏也能保持可扫描性。共有四个级别:L(低,约7%恢复率)、M(中,约15%)、Q(四分之一,约25%)和H(高,约30%)。纠错级别越高,容错性越强,但数据容量越小。M级适合一般用途,而H级最适合需要添加Logo覆盖层或印刷在容易损坏表面的场景。
二维码可以从多远的距离扫描?
扫描距离大约是二维码宽度的10倍。一个3厘米(约1.2英寸)的二维码可以从约30厘米(12英寸)的距离扫描。对于广告牌或标识,需要更大的二维码。可靠扫描所需的最小模块尺寸约为0.33毫米,并且码的四周必须有至少4个模块宽度的白色静区(边距)。
如何创建WiFi二维码?
在生成器中选择WiFi选项卡,输入网络名称(SSID),选择加密类型(WPA/WPA2最常见),输入密码,并可选择将网络标记为隐藏。生成器会创建标准WIFI:格式的二维码。当有人用智能手机扫描此码时,将自动提示加入网络,无需手动输入密码。
静态二维码和动态二维码有什么区别?
静态二维码直接编码数据——内容固定,打印后无法更改。动态二维码编码一个指向实际内容的短重定向网址;您可以随时更改目标网址而无需重新打印。本生成器创建静态二维码。如需动态二维码,请将网址编码到您控制的重定向服务中。
二维码最多可以存储多少数据?
最大数据容量取决于纠错级别和编码模式。在L级纠错下,版本40的二维码(177×177模块)最多可存储7,089个数字、4,296个字母数字字符或2,953字节的二进制数据。较高的纠错级别会降低容量。对于大多数实际用途,将数据保持在300字节以下可产生易于扫描的码。
我可以自定义二维码的颜色吗?
是的,本生成器允许您选择自定义的深色和浅色。但为了最佳可读性,两种颜色之间应保持强对比度。深色模块应明显比浅色模块深。避免将浅色用于深色模块或将深色用于背景,因为某些扫描仪可能无法读取低对比度的二维码。黑白配色可提供最高的可靠性。
这个二维码生成器是免费的吗?
是的,本二维码生成器完全免费,无需注册。您可以生成无限数量的网址、文本、WiFi、邮件、电话号码和短信二维码。可将二维码下载为高质量的PNG或SVG文件。所有处理均在您的浏览器中完成——数据不会发送到任何服务器。
应该下载PNG还是SVG格式的二维码?
印刷材料(名片、传单、海报)请选择SVG,因为SVG是矢量格式,可缩放至任意大小而不失真。数字用途(网站、社交媒体、邮件)请选择PNG,因为它被普遍支持。PNG文件有固定分辨率,如果您计划大尺寸展示,请生成较大尺寸的PNG。
二维码可以从屏幕上扫描吗?
是的,二维码可以直接从电脑显示器、平板电脑或手机屏幕上扫描。大多数现代智能手机摄像头和二维码扫描应用可以读取任何显示器上的码。确保屏幕亮度足够,避免眩光。二维码应以足够大的尺寸显示,以便扫描设备能够读取——近距离扫描时,屏幕上至少需要2-3厘米。
About QR Codes
QR (Quick Response) codes are two-dimensional matrix barcodes invented in 1994 by Denso Wave, a subsidiary of Toyota. Unlike traditional one-dimensional barcodes that store data in horizontal lines, QR codes encode data in both horizontal and vertical directions, allowing them to store significantly more information in a compact square format. QR codes can be scanned by smartphone cameras and dedicated readers, making them a ubiquitous tool for sharing URLs, contact information, WiFi credentials, and more.
How QR Codes Work
A QR code is composed of black and white squares called modules arranged in a square grid on a white background. The code contains several key components:
- Finder patterns — Three large squares in the corners that help scanners detect and orient the QR code regardless of rotation
- Alignment patterns — Smaller squares that help correct for perspective distortion when scanning at an angle
- Timing patterns — Alternating black and white modules between finder patterns that define the grid coordinates
- Format information — Encodes the error correction level and mask pattern used
- Data and error correction — The actual encoded data along with Reed-Solomon error correction codewords
QR codes support four encoding modes: numeric (digits 0-9), alphanumeric (digits, uppercase letters, and symbols), byte (arbitrary binary data including UTF-8), and kanji (Japanese characters). The encoder automatically selects the most efficient mode for the input data.
Error Correction Levels
QR codes use Reed-Solomon error correction to remain readable even when partially damaged or obscured. There are four levels of error correction, each offering a trade-off between data capacity and resilience:
| Level | Recovery Capacity | Max Data (Version 40) | Best For |
|---|---|---|---|
| L (Low) | ~7% recovery | 2,953 bytes | Maximum data capacity, clean environments |
| M (Medium) | ~15% recovery | 2,331 bytes | General use, good balance of size and resilience |
| Q (Quartile) | ~25% recovery | 1,663 bytes | Printed materials that may get dirty or damaged |
| H (High) | ~30% recovery | 1,273 bytes | Logo overlays, harsh environments, maximum durability |
QR Code Data Types
- URL — The most common use. Encoding a full URL (e.g.,
https://example.com) allows scanners to open the link directly in a web browser - WiFi — Uses the
WIFI:T:WPA;S:NetworkName;P:Password;;format. When scanned, most smartphones will prompt to join the WiFi network automatically - Email (mailto:) — Encodes an email address with optional subject and body using the
mailto:URI scheme. Opens the default email client on the scanning device - Phone (tel:) — Encodes a phone number using the
tel:URI scheme. Scanning initiates a phone call - SMS — Encodes a phone number and optional message using the
sms:URI scheme. Opens the messaging app with a pre-filled recipient and message - Plain Text — Any arbitrary text content. Useful for encoding messages, serial numbers, product information, or any other textual data
QR Code Size and Scanning Distance
QR codes come in 40 versions (sizes), ranging from 21×21 modules (version 1) to 177×177 modules (version 40). The library automatically selects the smallest version that fits your data. When printing or displaying QR codes, consider these guidelines:
- Minimum size — Each module should be at least 0.33mm (about 1/76 inch) for reliable scanning
- Scanning distance — As a rule of thumb, the scanning distance is approximately 10 times the QR code width. A 3cm QR code can be scanned from about 30cm away
- Quiet zone — Maintain a white border (margin) of at least 4 modules around the QR code for reliable detection
- Contrast — Ensure strong contrast between the dark and light modules. Black on white provides the best readability
- Print resolution — For print, export at 300 DPI or higher. SVG format is ideal for print as it scales without quality loss
Best Practices for QR Codes
- Keep the encoded data as short as possible — use URL shorteners for long URLs to produce smaller, easier-to-scan QR codes
- Test your QR code with multiple scanning apps and devices before distributing it
- Use error correction level M or higher for printed materials that may get creased, stained, or worn
- Avoid inverting colors (white on black) as some older scanners may not read inverted QR codes
- Do not distort the aspect ratio — QR codes must remain perfectly square
- If adding a logo overlay, use error correction level H and keep the logo small (no more than 10-15% of the QR code area)
- For dynamic content, consider using a URL that redirects to the target — this lets you update the destination without reprinting the QR code
- Always provide a text alternative (URL, phone number) alongside the QR code for accessibility