QR Code
generator.
A QR code holds your link or WiFi login in its pattern, with no server in between.
Stored text: https://www.example.com
- Version
- 2
- Bytes used
- 23 of 2,331
- Level
- M
23 bytes fits version 2 at level M; at 30 mm wide with its margin, each module is 0.91 mm.
Print size
Drag the corner of the code- Each module
- 0.91 mm
- Code alone
- 22.73 mm
- Code with margin
- 30 mm
This content at each level
| Level | Built to survive | Version | Modules a side |
|---|---|---|---|
| L | about 7% | 2 | 25 |
| M (yours) | about 15% | 2 | 25 |
| Q | about 25% | 3 | 29 |
| H | about 30% | 3 | 29 |
A higher level adds redundancy, which makes the code denser for the same content.
Export as SVG for print, so the edges stay sharp at any size. A common laser printer reaches about 0.17 mm a module, which is a limit and not a target.
Many codes at once
One code per line
| Line | Version | File |
|---|---|---|
| https://www.example.com/table-1 | 3 | |
| https://www.example.com/table-2 | 3 | |
| https://www.example.com/table-3 | 3 |
How it's worked out
Your content is first turned into a plain line of text in the format a phone camera expects. A web address needs its https:// prefix, a phone number becomes a tel: link, and an email becomes a mailto: link. That line is all the code holds, and a phone camera offers to act on it, for example by joining the network in a WiFi code.
- Web link: https://example.com
- Phone: tel:+15550100199
- Email: mailto:name@example.com?subject=Hello
- Text message: SMSTO:+15550100199:Your message
- WiFi: WIFI:T:WPA;S:network;P:password;;
The encoder then picks the smallest size that holds the text at your chosen level of error correction. Sizes are called versions, and each one is a square grid of modules, the small dark and light squares. The three large squares in the corners let a camera find and straighten the code. Reed-Solomon error correction is what lets part of it be damaged and still read.
Here v is the version, from 1 to 40. Denso Wave, which announced the format in 1994 (it is now the ISO/IEC 18004 standard), gives 21 modules a side for version 1 and 177 modules for version 40. More text or more error correction pushes the code to a higher version, so the modules get smaller at the same printed size.
The extra 4 on each side is the quiet zone, a clear margin that Denso Wave says every QR Code requires.
Worked examples
A table card for a cafe menu
The owner types www.example.com/menu and the code stores https://www.example.com/menu. At level M that is 28 bytes in a version 3 code, 29 modules a side.
| Level | Built to survive | Version | Modules a side |
|---|---|---|---|
| L | about 7% | 2 | 25 |
| M | about 15% | 3 | 29 |
| Q | about 25% | 3 | 29 |
| H | about 30% | 4 | 33 |
She has 30 mm on the card, margin included, which makes each module 0.81 mm. A common laser printer can reach about 0.17 mm a module, so this code could print as small as 6.29 mm, but a phone at arm's length may not read one that tiny. She tests a printed card before ordering 200.
A guest WiFi code with a tricky password
The network is Harbor Cafe and the password is Back\room:2026. Both the backslash and the colon mean something in the WiFi format, so each one gets a backslash in front. The stored text becomes WIFI:T:WPA;S:Harbor Cafe;P:Back\\room\:2026;;.
That is 45 bytes and a version 4 code at level M. The password sits in the code as plain text, so anyone who scans it can read it. Print this one for a guest network and not your main network.
A long campaign link against a short one
A flyer printed at 25 mm with level Q has a choice. The full tracking link is 115 bytes, which needs version 9 and modules of 0.41 mm. A short address on the same site is 21 bytes, version 3 and modules of 0.68 mm.
That is modules 1.6 times as wide at the same print size, and wider modules are easier for a camera. Point a short path on your own site at the long link, and you can also change the destination later without reprinting.
Reading your result
Pick the level for the conditions. Denso Wave says level M is the one most often chosen, with Q or H for dirty places such as factories and L for clean places with a lot of data. Higher levels mean a bigger, denser code.
| Level | Built to survive | Bytes |
|---|---|---|
| L | about 7% | 2,953 |
| M | about 15% | 2,331 |
| Q | about 25% | 1,663 |
| H | about 30% | 1,273 |
A byte is not always a character. Plain English letters take one byte each, while accented letters and many other scripts take two or more. The figure of 2,331 at level M is the limit, and a code that full is far too dense to print small.
Check the size against the distance. Denso Wave's worked example is a version 3 code at 0.254 mm a module, which is 7.37 mm wide and 9.4 mm with its margin. That suits a scanner held close and not a poster across a room. We found no primary source for a size-to-distance rule, so test yours at the real distance.
Static means no one in the middle. These codes hold the content itself, so no service is called when someone scans, and there is no account to lapse. The cost is that you cannot count scans, and you cannot change the content of a printed code.
Common mistakes
- Cropping the margin. Designers often trim the white space to fit a layout. Denso Wave asks for 4 clear modules on all four sides, and a dark edge up against the pattern can stop a scan.
- Reversing the colors or using pale ones. Denso Wave advises printing black on white. Colored codes can scan, depending on the pair of colors, but test them first.
- Covering part of the code with a logo. That spends the error correction on damage you made on purpose. Denso Wave warns that a code changed this way is relying on that function, and asks you to consult it before adding a design.
- Printing a link you do not control. The code will keep pointing at the address even after the page is gone. Use an address on your own site that you can keep alive.
- Putting codes where someone can cover them. The FTC reports scammers placing their own codes over the ones on parking meters. Print your web address beside the code so people can check where it goes.
Questions people ask
Sources
- Denso Wave, Information capacity and versions of QR Code
- Denso Wave, Error correction feature
- node-qrcode, the encoder library behind this tool (README)
- Denso Wave, How to use QR Code: code size
- Denso Wave, FAQ
- Denso Wave, History of QR Code
- ZXing project, Barcode Contents
- Federal Trade Commission, Scammers hide harmful links in QR codes to steal your information (December 2023)