15.09.2026

QR codes on labels: calculating the size including the white margin

QR codes on labels: calculating the size including the white margin

Two QR codes can occupy the same 20 × 20 mm area yet have different sized squares inside. Checking only the object’s width in the layout is therefore insufficient: you need the symbol’s module count and the clear margin around it.

For a standard QR code, leave a clear margin at least four modules wide on every side. If the overall side length including this margin is A and the symbol has N modules per side, one module measures m = A / (N + 8). This rule does not establish a universal minimum of 20 mm.

The same area, different detail sizes

Both examples encode the same complete address, https://myprint.ua/ua/. Versions 3 and 10 were deliberately selected for comparison, with the same error correction level M. The higher number does not mean a longer address here: we change only the version to show the geometry.

Worked example · overall size 20 × 20 mm

Version 3 · 29 × 29

Matrix excluding the outer margin

20 mm including the margin

One module m

≈ 0.541 mm

20 / (29 + 8)

Margin on one side 4m: ≈ 2.162 mm

Side of the symbol itself Nm: ≈ 15.676 mm

Version 10 · 57 × 57

Matrix excluding the outer margin

20 mm including the margin

One module m

≈ 0.308 mm

20 / (57 + 8)

Margin on one side 4m: ≈ 1.231 mm

Side of the symbol itself Nm: ≈ 17.538 mm

The codes are enlarged and shown at the same scale. Values are rounded after calculation. This compares geometry; it does not establish an acceptable size for a particular printer or camera.

Where the symbol ends and the margin begins

A module is one smallest black or white cell in the grid. The symbol is the entire N × N grid, including its internal white cells. The clear margin, or quiet zone, lies outside it: text, frames and background artwork must stay out. Additional space to the label edge may be larger, but it does not replace this margin.

Width breakdown with the minimum margin · N = 29

4m
N × m
4m

4m — margin · N × m — symbol

A = 4m + Nm + 4m = (N + 8)m

The same margins are needed above and below. Colour identifies the parts of this measurement diagram; the actual QR margin stays clear and light.

For a 29 × 29 matrix within a 20 mm square, the symbol itself measures approximately 15.676 mm per side, with a 2.162 mm margin on each side. For 57 × 57, the symbol occupies approximately 17.538 mm, yet its modules are smaller. Cropping the white margin to make the QR code fit removes space required around the symbol.

Find N without counting dozens of cells

Look for the version number in your QR generator or the properties of the code it creates. For a standard QR code of version v from 1 to 40, calculate the number of modules per side as follows:

N = 21 + 4 × (v − 1)

Version 3: 21 + 4 × 2 = 29. Version 10: 21 + 4 × 9 = 57.

If the version is not shown, look for the matrix dimensions in the generator’s report, or export the matrix itself and check its row or column count. A value such as 29 × 29 must describe the symbol without its outer white margin; both black and white modules count.

When the PNG export settings are known

Suppose the export is set to 10 pixels per module with a four-module margin. The file is 370 pixels wide:

370 / 10 − 4 − 4 = 29 modules

PNG width alone is insufficient: you need its actual export settings. File pixels here help identify the grid; they do not set the physical print size.

These formulas apply to standard QR codes. Micro QR, Data Matrix and other code types have different margin rules and grid dimensions.

If the modules are too small

The calculated value tells you what the printer must reproduce and the camera must distinguish. If the print is unclear or reading is unreliable, there are two ways to reconsider the layout:

Give the QR code more room

Enlarge the whole square, including its margin, while preserving its proportions. With N unchanged, both the modules and the margin grow. Check the overall white square’s dimensions in the layout, rather than just those of the black artwork.

Shorten the encoded content

Where appropriate, use a shorter address for the intended page and regenerate the QR code with automatic version selection. Check the new N: it may decrease, but that depends on the encoding and error correction level. Simply deleting text next to the QR code does not change its matrix.

The label’s base matters too

For a small label used in dry indoor conditions, you can start with the inkjet photopaper range (Ukrainian page) and consider self-adhesive options. An opaque white medium helps preserve the code’s light areas regardless of the box colour or bag contents.

One specific example is My Print A4 matte self-adhesive paper (Ukrainian page): a 120 g/m² face layer and 50 sheets per pack; its product page specifies inkjet printing with dye or pigment ink. Check which media your printer’s manual allows. This example concerns dry indoor labelling, rather than labels intended for washing or outdoor use.

The word ‘matte’ in a paper’s name does not establish readability. A shiny coating, a transparent base, a dark background or a fold through the code can change the result. For the trial, keep the QR code black on white and place it on a flat part of the finished packaging.

One print trial to help you decide

Print the final file on the chosen medium at its intended size: 100% scale, without fitting to the page. Measure the side of the entire QR code including its margin: it should match your layout, which need not use the example’s 20 mm. Apply the trial label to the final surface.

Inspect the module edges under magnification: have neighbouring details merged, and is the surrounding margin clear? Then scan the code on the trial label with the intended phone or scanner, at the expected distance and lighting. Check the address it opens as well: it must be the intended page.

Unclear modules are a reason to reconsider their size and print reproduction. If details are sharp but reading depends on the angle or flattening the bag, examine reflections, folds and placement. Repeat the same trial after making a change. Correct geometry gives you a layout to check; a successful trial confirms only the material and conditions tested.