企评社

Interface labels are shown in English. Company reviews, forum posts and tool descriptions are currently available in Chinese only.

QR code generator

URLs, Wi-Fi, vCards and SMS/tel in one go; the code is drawn in your browser — content is neither uploaded nor stored.

内容只在你的浏览器里生成二维码,不上传、不留存
先说清楚:二维码本身不含加密。 二维码只是把文字换一种画法,任何扫码工具都能把里面的内容原样读出来,谁看见这张图谁就看见了内容。 所以不要用它存放密码、身份证号、银行卡号等敏感信息(包括不要用这种方式分享 WiFi 密码给不特定的人); 确实需要保密时,请改用带密码的专用工具,或先把内容加密再生成二维码。本页只是"画图工具",不做也做不到加密。

文本 / 网址

网址建议带上 https://,扫码后手机才知道要用浏览器打开;内容可以是中文(本页按 UTF-8 编码)。

(用来验证中文能正常生成)

生成参数

导出 PNG 的边长。太大的二维码印在小卡片上反而扫不出来,一般 300 ~ 600 像素够用。

越高越抗污损、被遮挡也能读,但同一张二维码能装的内容越少——内容多到装不下时会提示你降低等级或缩短内容。

标准要求四周各留 4 个模块的空白,本页默认保留。改成 0 虽然图更"满",但很多扫码器会直接识别失败——不要为了省地方去掉它。

深色码点 + 浅色背景最好读(黑底白字这类反色二维码,部分扫码器不认)。两色太接近时本页会提示对比度不足。

预览与下载

预览显示的是等比缩放的图片,下载得到的是你设定尺寸的原始 PNG(文件名形如 二维码-网址-20260607120000.png)。 下载由浏览器本地完成,整页没有任何上传请求。

二维码怎么生成:容量、静默区、对比度与四类常用内容

二维码能装多少字,取决于版本与纠错等级。二维码共 40 个"版本",版本越高格子越多(版本 1 是 21×21 个模块,版本 40 是 177×177),能装的内容也越多。同样一张二维码,纠错等级越高,用来"备份"的格子越多、留给正文的就越少:最高容量出现在低纠错等级,反之要更强的抗损能力就得牺牲容量。这也是为什么"内容太长生成失败"时,最快的解决办法是把纠错等级从 H 降到 M 或 L,或者把内容缩短、改成短链接。本页用 qrcode-generator 按标准自动选版本(版本 0 表示自动),中文按 UTF-8 编码,一个汉字通常占 3 个字节,所以中文内容能装的字数大约是英文的三分之一——遇到超长内容本页会直接提示"内容太长,请缩短或改用更低的纠错等级",而不是抛出一个看不懂的错误。

为什么必须留静默区。二维码规范要求码点区域四周各留至少 4 个模块宽度的空白,这块空白叫静默区(quiet zone)。它不是浪费:扫码器先用这圈空白判断"哪里是二维码的边界",再去做定位与采样。一旦静默区被切掉或被别的图案、文字、色块填满,扫码器可能把边界认错,表现就是"图看着很清楚,手机却怎么也扫不出来"。所以做海报、名片、贴纸排版时,务必让二维码四周留出空白;本页把静默区做成参数(默认 4 个模块)并保留在导出图里,你可以调大,但不建议调成 0。

颜色对比度决定"能不能被识别",不是好看不好看的问题。扫码器先把彩色图转成灰度,再按阈值判黑判白。前景(码点)与背景的亮度差得越多,二值化越干净;反差太小,比如浅灰码点配白底、深蓝配深灰,就会有一批模块被判成"灰"而丢失,从而读不出来。稳妥的做法是深色码点配浅色背景(黑/白、深蓝/白都很好),并且别用明显的渐变或带纹理的照片当背景。本页按 WCAG 的相对亮度公式算出两色的对比度(黑配白是 21:1,白配白是 1:1),低于 3:1 会提示"对比度太低可能导致无法识别",把判断权交给你,但不假装它没问题。

WiFi 与名片二维码为什么手机一扫就懂。手机相机并不是"认识"这些内容,而是二维码里面写了一段有固定格式的纯文本:WiFi 用 WIFI:T:WPA;S:名称;P:密码;;,iPhone 与主流安卓都会解析它并弹出"加入网络",不用再口述密码;名片用 vCard(BEGIN:VCARD 开头),系统会识别成联系人并提示保存;短信和电话分别用 SMSTO: 与 tel:。正因为是固定格式,字段里的分隔符必须正确转义——WiFi 名称或密码里含 ; , : " \ 时要加反斜杠,vCard 的每一行必须以 \r\n 结尾,否则部分机型会解析失败。本页把这几条拼装规则写成了可断言的纯函数,转义由程序完成,不需要你手写。

为什么我们不上传到服务器生成。很多"在线二维码生成"是把你的内容提交给服务器、服务器画好图再传回来——这意味着你的 WiFi 密码、手机号、地址会经过别人的服务器,还可能被记录。二维码的生成完全不需要后端:它只是一段确定的几何计算(数据编码、纠错、掩码、画格子),浏览器里几百毫秒就能算完。所以本页全程在你自己的设备上完成,没有上传接口(打开浏览器开发者工具的 Network 面板,整页不会出现任何提交请求);内容也不写进网址、localStorage 或 cookie,关掉页面就什么也不剩。需要重复使用同一个二维码时,请自己保存下载的 PNG,而不是把内容留在网页里。

FAQ

Can a QR code be encrypted? Is it safe to put a password in one?

No. A QR code is an encoding, not an encryption: its contents are plain text to any scanner - readable even without scanning, by ordinary decoding software. So do not put passwords, ID numbers or bank card numbers into a QR code. A WiFi QR code is convenient, but it is effectively showing your password to everyone who sees the image - place it only in trusted settings (your home, an internal office), never in publicly accessible places. When secrecy is genuinely needed, use a dedicated password-protection tool, or encrypt the content first and encode the ciphertext.

Why does the generated image keep a white border? What if I set the quiet zone to 0?

That margin is the quiet zone; the specification requires at least 4 modules of blank on all four sides. Scanners use it to find the code's edges. When the quiet zone is cropped or pressed against dark elements, scan success drops noticeably - worst of all on colored backgrounds, shelf labels or business-card corners. This page defaults to 4 modules and draws them into the exported image; you may enlarge it (wider is easier to scan on sticker sheets), but setting it to 0 is not recommended.

Why does the same content become 'too long' at a higher error-correction level?

Because error-correction data competes with your payload for the same QR space. Higher levels reserve more cells for correction and leave less capacity for content. Version 40 (the maximum) fits roughly 2,900-odd bytes at the lowest level but only about 1,200 at the highest; Chinese in UTF-8 takes 3 bytes per character, which widens the gap further. Three fixes: shorten the content, swap a long URL for a short link, or drop the level to M or L. For everyday use, M (about 15%) already survives print wear and light smudges.

My WiFi / vCard QR codes - why do some phones scan them with no reaction?

Format first, then clarity. WiFi and vCard both demand strict field formats: semicolons, commas, colons, quotes and backslashes inside names or passwords must be escaped, and every vCard line must end with carriage-return plus line-feed - otherwise the system cannot recognize it as structured content and shows it as plain text. This page assembles to the standard and escapes automatically; you can expand 'the raw content that will be written' below and check it word by word. If the format is fine, check whether the quiet zone got cropped, whether the print is too small (under 2 cm square scans poorly), or the color contrast is too low.

Is my content uploaded or stored? Why is there no generation history?

Neither. The whole generation happens inside the page you have open; there is no upload endpoint, and nothing is written to the URL, localStorage, sessionStorage or cookies - refreshing returns a blank slate. No history is a deliberate choice: this content is often a WiFi password, a phone number, a home address - keeping it in local storage would itself be a risk. If you need it again, keep the PNG you downloaded.

Related tools