QRAnalytica

Does a QR Code Need a White Border?

Yes. A QR code needs a plain light border, called the quiet zone, four modules wide on every side. It doesn't have to be pure white.

Nookesh Karri · 7 min read
Dark cover card with the title 'Does a QR Code Need a White Border?' in white and a lime accent bar

Yes, a QR code needs a border, but it doesn’t have to be pure white. The rule is a plain, light margin at least four modules wide on every side, called the quiet zone. Cream, pale grey or any light shade that matches the code’s light squares works, as long as nothing else is printed in it.

Treat the QR code white border as part of the symbol. Measure it in modules, reserve it in your layout, and keep everything else out.

Why does a QR code need a white border?

A QR code needs a white border because the scanner uses that empty space to find where the code begins and ends. The original specification from the inventor says the symbol area requires a margin or “quiet zone”, a clear area where nothing is printed.

Without that gap, the three big corner squares blend into whatever sits next to them. Text, a photo, or a dark box right against the code all look like more modules to the camera. Design guidance puts it bluntly: that empty border isn’t optional, because crowded edges stop scanners from telling where the code ends.

Picture a menu card where the designer tucks the code into a corner and runs the price list right up to its edge. The phone sees one big pattern instead of a square symbol, and the camera hunts.

How wide the quiet zone has to be

The quiet zone for a standard QR code is four modules wide on all four sides. A module is the smallest black or white square in the code, so the margin grows with the code.

Code typeQuiet zone on each side
Standard QR code (Model 1 and 2)4 modules
Micro QR code2 modules

One scanner SDK’s docs agree: a 4X quiet zone is required, and Micro QR codes need 2X. The vendor also says it doesn’t recommend codes that break the ISO specification, currently ISO/IEC 18004:2024.

Phone users rarely meet Micro QR. If a normal generator made your code, plan for four modules.

Turning four modules into millimetres

The easiest way to size the border is to count modules, then multiply by your module size. A worked example from a barcode scanner maker uses a module size of 0.25 mm on a version 1 code, which is 21 by 21 modules. The code itself is 5.25 x 5.25 mm, and the space you need including margins is 7.25 x 7.25 mm.

  1. Count the modules across one row of your code. Version 1 is 21, and bigger codes have more.
  2. Divide the printed width by that count to get the module size.
  3. Add four modules on each side. That’s eight extra modules across the full width.
  4. Reserve that whole square in your layout and keep it empty except for the code.

People skip step 4. They size the code, then let other elements creep into the margin later. For picking the overall print size, see how big a QR code should be when printed.

Does the border have to be white?

The border doesn’t have to be white, but it must be light, plain and the same as the code’s light squares. The inventor’s FAQ advises printing black on a white background as the basic rule, and notes that the depth of the colors affects readability.

A cream poster with a dark navy code and a cream margin works. So does a white margin around cream light squares, since both are light. A margin that is dark, patterned, or a different strong color fails.

Red is the trap. The same FAQ explains that scanners use red light, so some readers can’t see a red code on white. If you’re choosing colors, read what colors a QR code can be and still scan before you print.

Common ways people lose the border by accident

Most quiet zone problems come from layout and file handling, not from the generator. These are the cases I see most.

SituationWhat goes wrongFix
Code placed on dark packagingThe dark box touches the code’s edgePut the code in a light box with a four-module margin
Design file cropped tightThe download had a margin, the crop removed itCrop to the outer edge of the margin, not the code
Colored frame or call-to-action badgeThe frame sits right against the modulesKeep the frame outside the light margin
Clear sticker or glassNo light background behind the codePrint a white layer under the code, as the inventor’s FAQ advises for transparent materials
Light code on dark backgroundThe colors are reversedSwitch back to dark modules on a light background

One scanning SDK vendor calls inverted colors one of the most common errors and says default barcode SDKs can’t decode inverted codes. Some phone cameras cope, but you can’t count on every app your customers use.

Logos create a similar crowding problem inside the code. If you’re adding one, see whether a logo in the middle of a QR code is safe.

Can I add a frame or border design?

Yes, you can add a frame, as long as it sits outside the quiet zone. Design guidance says to keep any border or frame outside the quiet zone and to preserve the clean margin between the code and the frame.

Good: code, four modules of light space, then a colored frame that says “Scan for the menu”. Bad: a thick brand-colored ring hugging the modules. Both look branded. Only the first scans reliably.

My take, and one limitation

My take: four modules is the floor. Leave extra on anything printed small or viewed at an angle, like table tents or shop windows. Light space costs nothing, and a missing margin is the cheapest scanning failure to avoid.

The limitation: a phone test in your office doesn’t prove the margin is safe. Your phone may read a cramped code that an older phone, a cheap scanner app, or a shop till rejects. QRAnalytica’s free QR validator checks color contrast and link safety before you print, but it doesn’t measure your margin in modules, so count those yourself. If a printed code already fails, work through why a QR code is not scanning.

FAQ

How wide should the white border around a QR code be?

At least four modules on every side, where a module is one of the small squares in the code. A Micro QR code needs two modules instead.

Does the border around a QR code have to be white?

No. It has to be plain, light and the same as the code’s light squares. Cream or pale grey works if the dark squares contrast strongly with it.

Will a QR code scan without a border?

Sometimes, if the code happens to sit on a plain light surface. On a busy or dark background, scanners struggle to find where the code starts and ends, so many scans fail.

Can I put a colored frame around my QR code?

Yes, as long as the frame sits outside the quiet zone. Keep the four-module light margin between the code and the frame.

Can a QR code be white on a black background?

It can be made, but reversed codes often fail because many scanner libraries don’t decode them by default. Dark squares on a light background are the safe choice.

Sources

Track your dynamic campaigns. 7-day trial, no credit card.
Generate Dynamic QR