The basic advice#
If you just want to know how to make the smallest possible standard QR code for a website,
- Use uppercase and no more than 25 characters (0–9, A–Z, space, and
$%*+-./:
). - If using non-alphanumeric characters, use no more than 17 characters.
- Include
http://
orhttps://
at the start of your URL for compatibility with all QR readers. This effectively limits you to 18 alphanumeric characters or 10 non-alphanumeric characters.
This will give you a 21x21 pixel (version 1) standard QR code.
You can generate these on your own with these two Python commands.
import segno
segno.make_qr("HTTPS://RYANAGIBSON.COM").show()
segno.make_qr("https://ryanagibson.com").show()
What about error correction?#
When creating small QR codes, you may want to enforce specific error correction levels. Higher correction levels enable faster and easier scanning, but decrease the maximum number of characters that you can fit in a 21x21 QR code.
Four levels are available, each offering different corruption tolerances and data storage capacities.
Error correction level | L (Low) | M (Medium) | Q (Quartile) | H (High) |
---|---|---|---|---|
Data corruption allowed | ~7% | ~15% | ~25% | ~30% |
Error correction level | Alphanumeric character limit | Byte character limit |
---|---|---|
L (Low) | 25 | 17 |
M (Medium) | 20 | 14 |
Q (Quartile) | 16 | 11 |
H (High) | 10 | 7 |
For example, the following QR codes are all for HTTPS://RYGI.ME with the maximum amount of data corruption shown.1 Despite this, they should still scan correctly.
As usual, error correction also lets you add in artistic embellishments, even with the tiny size! This obviously affects the error correction’s effectiveness, but can make your QR code more eye-catching. Here are a few examples I played around with.
In fact, with slight tweaks to the URL, you can artistically corrupt the QR code beyond the theoretical limits of error correction! This would be most useful if you set up redirects to the desired page, but short domains are often explicitly set up for redirection anyway.
Below are two examples where a 15x5 pattern is incorporated into the design. This region of 75 pixels is relatively massive considering that a version 1 QR code has a data capacity of only 136 bits. Indeed, the corrupted region is more than 150% the maximum amount this QR code can normally correct!
Complete tables of QR code character limits#
If you’re interested in a more comprehensive reference of the character limits for QR codes, please refer to “Complete Tables of QR Code Character Limits”.
See also and references#
- The segno Python package for generating standard QR codes and the significantly
less supported (and seemingly proprietary) Micro QR codes.
- The smallest Micro QR code is 11x11 pixels, but could only hold enough data to store a URL (with the
http://
prefix) in the 15x15 pixel variant. That one could hold up to HTTP://RYGI.ME. - The largest Micro QR code is 17x17 pixels, which could hold up to HTTP://RYANGIBSON.DEV.
- The smallest Micro QR code is 11x11 pixels, but could only hold enough data to store a URL (with the
- Wikipedia’s QR Code article for a general overview of the standard, its design, features, etc.
- Denso Wave’s What is a QR Code? which discusses more advanced concepts and features of the code. One interesting feature is to split the data into multiple chunks, each with its own encoding, for even more optimal storage.
The last one with high error correction drops the
HTTPS://
, so it will scan as text rather than a URL on some systems. For websites, version 1-H is essentially impossible sinceHTTP://R.G
is already 10 characters and single-character TLDs do not currently exist. ↩︎