QR Code Minimum Size: Measured Pixels, Centimetres by Distance and PNG vs JPG
QR code minimum size from decoder tests: pixels per module for versions 1 to 10, centimetres by scan distance, DPI for print, business card size and PNG vs JPG vs SVG.
On this page ⌄
For a short URL, a printed QR code should be at least about 2 cm wide, quiet zone included, if people scan it from card distance (Bitly gives 2 cm x 2 cm as its minimum and a distance-to-size ratio of about 10:1). The reason is pixels, not centimetres: in the tests below the open-source ZXing-C++ decoder read every clean code from 2 camera pixels per module and every degraded one from 2.5, while OpenCV needed roughly 3 to 8 and was erratic, so the size you print is the number of modules, times about 3 pixels (a safety margin), times how large one pixel is at your scanning distance. A longer URL means more modules and a bigger code at the same distance. The tables below give that size, and the file-format section answers PNG vs JPG vs SVG with measurements. Make the code with the QR Code Generator; for a code that already exists and will not scan, see QR code not scanning.
What the decoders needed: pixels per module
Codes were rendered at six versions, error correction level M, a 4-module quiet zone, from a URL-like payload that was grown one character at a time until it just reached that version. Each was rendered at 16 pixels per module, shifted by a random sub-pixel phase, shrunk with a Lanczos filter to a given number of pixels per module (10 trials per setting) and read by two independent decoders. A second condition added blur (sigma 0.3 module), Gaussian noise (sd 6 grey levels) and a random rotation of up to 8 degrees.
| Version | Modules per side | Payload used (characters) | ZXing-C++ reads 10/10 from (clean / degraded) | OpenCV reads 10/10 from (clean / degraded) |
|---|---|---|---|---|
| 1 | 21 | 13 | 1.75 / 2.5 | 5 / 6 |
| 2 | 25 | 15 | 1.5 / 2 | 5 / 7 |
| 3 | 29 | 27 | 1.5 / 2 | 3 / not stable |
| 5 | 37 | 63 | 1.5 / 2 | 4 / not stable |
| 7 | 45 | 107 | 1.75 / 2 | 3 / 8 |
| 10 | 57 | 181 | 2 / 2 | not stable / not stable |
"From" means the lowest tested value at which every larger tested value also passed (values tested: 1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4 and 5 to 8 px per module). Counts at 1.5 and 1.75 px vary from run to run, so the practical decoder floor for ZXing-C++ is 2 px per module clean and 2.5 with blur, noise and tilt. OpenCV's QRCodeDetector was erratic rather than just stricter: at version 10 it read 2 to 9 of 10 on the degraded images at 4 to 8 px with no steady rise, so it says more about that detector than about QR codes. Phones use their own decoders, so neither number is a promise for a particular phone.
Two things follow. A QR code does not need a huge number of pixels, and the stricter decoder shows why a design target of 3 px per module (a floor with a margin over the 2 to 2.5 that ZXing-C++ needed) and 6 px per module (comfortable) is sensible. The number of modules is the lever you control, and it is set by how much you encode.
How much you encode sets the module count
Each extra block of characters raises the version, and every version adds 4 modules per side (Denso Wave: version 1 is 21 x 21 and version 40 is 177 x 177, 17 + 4 x version). The payload column above is the smallest URL-like string that needed that version at level M, found by growing the string until the library moved up. Version 2 started at 15 characters, version 5 at 63, version 10 at 181. The Node qrcode library the site's generator uses, run on the same strings, also returned versions 2, 5 and 10.
Practical consequences: a printed tracking URL of 100+ characters needs version 7 or higher (45 modules) where a 15 character one needs version 2 (25 modules), so at the same distance the code is 1.8 times wider. Print a short redirect URL and keep the long parameters server side. Lower error correction also lowers the version, which is why level L is the usual choice for clean flat print and level Q or H is for codes that may be damaged or carry a logo.
QR code size by scanning distance
Formula: width in cm = (modules + 8) x pixels per module x scene width at distance d / frame width in pixels. With the assumptions below this is width = (modules + 8) x pixels per module x distance x 0.000995 (rounded to 0.001 it is distance / 1000, which gives values up to 0.5% higher).
Assumptions (not measurements of any specific phone): a 65 degree horizontal field of view, so the scene width at distance d is 2 x d x tan(32.5 degrees) = 1.274 d, and a 1280 pixel wide scanning stream. A narrower lens or a lower-resolution stream makes the numbers worse; a higher-resolution one, or a phone held closer, makes them better. The 8 extra modules are the 4-module quiet zone on each side (Denso Wave: "QR Code requires a four-module wide margin at all sides of a symbol"), so the sizes include the margin. The symbol itself is the total times modules / (modules + 8).
Size in cm, quiet zone included, minimum (3 px per module) / comfortable (6 px per module):
| Scan distance | Version 2 (25 modules, short URL) | Version 5 (37 modules, ~60 characters) | Version 10 (57 modules, ~180 characters) |
|---|---|---|---|
| 25 cm | 2.5 / 4.9 | 3.4 / 6.7 | 4.9 / 9.7 |
| 50 cm | 4.9 / 9.9 | 6.7 / 13.4 | 9.7 / 19.4 |
| 1 m | 9.9 / 19.7 | 13.4 / 26.9 | 19.4 / 38.8 |
| 2 m | 19.7 / 39.4 | 26.9 / 53.8 | 38.8 / 77.6 |
| 5 m | 49.3 / 98.5 | 67.2 / 134.4 | 97.1 / 194.1 |
| 10 m | 98.5 / 197.1 | 134.4 / 268.8 | 194.1 / 388.2 |
This is guidance derived from the decode tests plus an assumed camera, not a guarantee: print a proof at the final size and scan it from the real distance with the phones your audience has.
Is the 10:1 distance rule right?
Bitly states it: "The QR Code distance-to-size ratio is about 10:1." No standards body source was found for it (the two Denso Wave pages read for this guide, on margins and cell size, say nothing about reading distance), so treat it as a rule of thumb. The table shows when it works: a version 2 code at 3 px per module needs a width of 0.099 x the distance, almost exactly 1:10. A version 5 code needs about 1:7.4 and a version 10 code 1:5.2. Use 10:1 for a short URL under good light, and the table (or a bigger code) for anything denser.
Business card, flyer, poster
Using the table with hold distances that are estimates:
| Use | Typical distance | Version 2 (short URL) | Version 5 (about 60 characters) |
|---|---|---|---|
| Business card | 25 cm | 2.5 to 4.9 cm | 3.4 to 6.7 cm |
| Flyer or leaflet | 40 cm | 3.9 to 7.9 cm | 5.4 to 10.7 cm |
| Poster read from a step back | 1.5 m | 14.8 to 29.6 cm | 20.2 to 40.3 cm |
| Shop window | 3 m | 29.6 to 59.1 cm | 40.3 to 80.6 cm |
What is the minimum size for a QR code on a business card? About 2 to 2.5 cm in total with a short URL and a clean print, which matches Bitly's "at least 2 cm x 2 cm". A card holder at normal distance gets more margin from 3 cm. Put the code on the plain side of the card with the 4-module margin kept free: the margin is part of the size.
DPI and print dots
Denso Wave recommends for stable operation "that each module is made up of 4 or more dots", and notes that scanners have their own readable module-size limits. Dots per module, not the DPI figure by itself, is what to check:
| Printer resolution | One dot | 4 dots per module | Version 2 total (33 modules) | Version 5 total (45) | Version 10 total (65) |
|---|---|---|---|---|---|
| 150 dpi | 0.169 mm | 0.677 mm | 22.4 mm | 30.5 mm | 44.0 mm |
| 300 dpi | 0.085 mm | 0.339 mm | 11.2 mm | 15.2 mm | 22.0 mm |
| 600 dpi | 0.042 mm | 0.169 mm | 5.6 mm | 7.6 mm | 11.0 mm |
Totals include the quiet zone. Because the camera needs far more room than the printer does, the minimum in the distance table is the binding one at any common DPI. A 4-dot module at 300 dpi is 0.339 mm, so even a version 10 code at 22 mm is printable; the problem would be reading it. Ink spread, paper texture and glare were not tested: they widen dark modules and close up the small light ones, so print a proof.
PNG or JPG or SVG for a QR code
Use PNG for screens and when you need a raster, SVG when the code will be resized or sent to a printer, and avoid JPG. The data:
| Version | Pixels per module | PNG bytes | JPG quality 95 | JPG quality 50 | JPG quality 10 |
|---|---|---|---|---|---|
| 2 | 4 | 432 | 6,080 | 3,494 | 1,976 |
| 5 | 4 | 772 | 13,045 | 7,148 | 3,776 |
| 10 | 4 | 1,566 | 30,599 | 16,253 | 8,166 |
(4-module quiet zone included, so 16 px of white border; random lowercase URL payloads of 15, 63 and 181 characters; bytes from Pillow 12.3.0 at default settings, PNG with optimize=True. Exact byte counts change with the payload.) The lossless PNG is about 4.6 to 19.5 times smaller than the JPG at the same pixel size, because a two-colour image with hard edges is exactly what PNG compresses well and what JPEG's blocks handle badly.
Decoding results for the same files, read directly (screen view) by both decoders:
| What was exported | ZXing-C++ | OpenCV |
|---|---|---|
| PNG, 1 px per module | decoded all 3 versions | failed all 3 |
| PNG, 2 to 4 px per module | decoded | decoded versions 2 and 5; version 10 only at 2 px |
| JPG, 2 to 3 px per module, quality 100 down to 1 | decoded all 48 | decoded most, but failed at some qualities and sizes with no steady pattern (all of version 10 at 3 px) |
| JPG, 1 px per module, quality 100 to 50 (version 2) or 100 to 25 (versions 5 and 10) | decoded | failed |
| JPG, 1 px per module, quality 25 and below (version 2) or 10 and below (versions 5 and 10) | failed | failed |
OpenCV was erratic on the PNG files too (version 10 failed at 3 and 4 px but read at 2 px), so its failures cannot be blamed on the file format. The decode data says JPG is not what breaks a QR code at normal export sizes; the cost is file size, fuzzy edges, and a quality that can fall without anyone noticing, so there is no reason to choose it.
SVG: the generator's output is a vector with shape-rendering="crispEdges" (viewBox="0 0 33 33" for version 2 with a 4-module margin), about 1.2 KB for version 2, 2.5 KB for version 5 and 5.2 KB for version 10 (1,233, 2,500 and 5,188 bytes for the 15, 63 and 181 character payloads, from the Node qrcode library with margin 4). Opened in Chrome 157 at 1.5, 2, 2.5, 3 and 4 px per module (screenshots, 15 renders), ZXing-C++ read all 15 and OpenCV 8 of 15 (it failed every render at 1.5 and 2 px and read most from 2.5 px up). It scales to any print size, which is why it is the format to hand to a print shop. If you need a PNG, make its width an exact whole number of pixels per module, including the margin: (modules + 8) x pixels per module, for example a version 2 code is 25 + 8 = 33 modules, and 33 x 14 px = 462 px, so every module is the same width.
The site's generator downloads PNG and SVG only and defaults to a margin of 2 modules and 512 px, so raise the margin to 4 before exporting for print.
Questions
Do QR codes have to be black and white? No. The requirement is strong contrast with dark modules on a lighter background, plus the quiet zone. Measured contrast limits for colour codes are in QR code not scanning.
What if a QR code is too small to scan? Print it bigger (use the tables), shorten the URL so it drops a version, or lower error correction one level. Re-check the 4-module margin: a code that touches a border or image fails at sizes where an isolated one works.
What is the smallest a QR code can be? The decoder floor in these tests was 2 camera pixels per module for ZXing-C++, but a phone has to focus on the code and printing adds ink spread, so the practical floor is the vendor figure of about 2 cm in total for a short URL. A Wi-Fi login code is denser: see the Wi-Fi QR code guide.
Tested
2026-11-17: Python 3.11.15, segno 1.6.6, zxing-cpp 3.1.1, OpenCV (opencv-python-headless) 5.0.0, NumPy 2.4.6, Pillow 12.3.0; Node v25.8.0 with qrcode 1.5.4; Google Chrome 157.0.8103.78 headless for the SVG screenshots. Codes: versions 1, 2, 3, 5, 7, 10, error correction M, byte mode, quiet zone 4. Degraded condition adds blur (sigma 0.3 module), Gaussian noise (sd 6 grey levels) and rotation up to 8 degrees. Shrinking used Lanczos resampling from a 16 px per module render at random sub-pixel phase. Distance tables are computed from the stated formula and assumed camera (65 degrees, 1280 px). Not tested: real phone cameras, printed paper, ink spread, lighting and glare, curved surfaces, and the distances in the use-case table, which are estimates.
Sources
- Denso Wave, QR Code margin and cell guidance: four-module quiet zone, a 400 dpi printer example with 4 dots per module.
- Denso Wave, Minimum cell size: 4 or more dots per module recommended, print as large as the space allows, each scanner has its own readable module size.
- Denso Wave, QR Code versions: version 1 is 21 x 21 and version 40 is 177 x 177 modules; capacity depends on the data, character type and error correction.
- Bitly, What is the minimum size for a QR code?: 2 cm x 2 cm minimum and a distance-to-size ratio of about 10:1 (vendor guidance, not a standard).
Keep reading
QR Code Not Scanning? Causes, Fixes and Measured Limits
QR code not scanning? A symptom table plus measured limits for contrast, quiet zone, logo size per error correction level, blur, tilt, curvature and URL length.
WiFi QR Code Format: Exact WIFI: Payloads, Escaping and Scan Tests
The exact WiFi QR payload for WPA, WEP, open and hidden networks, the escaping rules for special characters, and a decode round trip of generated QR codes.
Related tools
QR Code Generator
Generate QR codes for URLs, text, Wi-Fi, contact cards. Custom size, colors, error correction. Download as PNG or SVG. 100% client-side.
Hours Calculator
Add start, end and break times for each day to see daily hours, weekly totals and overtime instantly.
Character Counter
Count characters, words, sentences, lines and UTF-8 bytes with live SEO and social media limit tracking.
Keyboard Test
Press any key to see it light up and find dead, stuck or double-typing keys, with rollover checks for full size, TKL and 75% layouts.
Written by Mian Ali Khalid. More guides in Dev Productivity.