Free tier, no card requiredDynamic QR codes that update after printGDPR-compliant scan analyticsBuilt for agencies, freelancers & in-house teamsFree tier, no card requiredDynamic QR codes that update after printGDPR-compliant scan analyticsBuilt for agencies, freelancers & in-house teamsFree tier, no card requiredDynamic QR codes that update after printGDPR-compliant scan analyticsBuilt for agencies, freelancers & in-house teamsFree tier, no card requiredDynamic QR codes that update after printGDPR-compliant scan analyticsBuilt for agencies, freelancers & in-house teams
All posts
An on-brand vector cover: a blue QR code that scans, beside a grid of coloured QR codes marked pass or fail by contrast.
Guide

Can a QR code be any colour? Contrast rules that keep it scannable

A QR code can carry your brand colours and still scan, but only if the modules stay clearly darker than the background. Here are the real contrast numbers, the colours that quietly fail, and how to brand a code without breaking the scan.

ScanKit

ScanKit · Organization

· 14 min read

Can a QR code be any colour?

Short answer: almost, but not quite. A QR code can carry your brand colours and still scan reliably, as long as you respect one rule that the format has depended on since it was invented. Scanners do not read colour. They read the difference in brightness between the dark modules (the little squares that hold the data) and the light background behind them. Get that brightness difference right and you have a lot of creative room. Get it wrong and the code becomes a decorative square that nobody can use.

For an agency, this matters more than it does for a hobbyist. You are putting a client's code on packaging, posters, vehicle wraps and shop windows, often at small sizes and in bad light, to be scanned by every phone model going back several years. A code that scans on your designer's new iPhone in the studio is not the same as a code that scans on a five-year-old Android in a dim cafe. This guide explains exactly how colour affects scannability, what the real contrast numbers are (and which widely quoted ones are myths), and how to brand a code without breaking it.

How a scanner actually sees your code

When a phone camera looks at a QR code, it does not care that your modules are navy blue or forest green. The first thing the decoding software does is throw the colour away. It converts the image to a single brightness (luminance) channel, then binarises it: every pixel is forced to either black or white based on whether it sits above or below a threshold. The QR pattern only survives this step if your dark modules end up on the dark side of the threshold and your background ends up on the light side.

This is a hard, sourced fact, not a guideline. Denso Wave, the company that invented the QR code, puts it plainly: "The reading of QR Codes is based on the difference between the amount of light reflected by the black and white areas." Colour is irrelevant except insofar as it changes brightness.

The detail that trips people up is how that brightness is calculated. The popular open-source decoder ZXing approximates luminance as (R + 2G + B) / 4, which weights green twice as heavily as red or blue. So green light contributes a lot of perceived brightness, while blue contributes very little. That single formula explains most colour failures: a colour that looks "dark enough" to your eye can be far brighter or darker to the binariser than you expect, because the maths does not match human perception.

Better decoders go a step further. ZXing's HybridBinarizer does not pick one threshold for the whole image; it computes a local threshold across a grid of small blocks, which is why it copes with shadows and uneven lighting. But the principle is unchanged: within any region, your modules must be clearly darker than the paper. If a gradient or a coloured background drifts across that local threshold mid-code, some modules vanish.

The one rule: dark modules on a light background

If you remember nothing else, remember this. The modules must be darker than the background, and the canonical, maximally compatible QR code is black on white. Denso Wave recommends dark-on-light explicitly, and the ISO/IEC 18004 reference decoding algorithm assumes it.

The reverse, light modules on a dark background (an "inverted" code), is not part of the required specification. Whether an inverted code scans is entirely up to the decoder. Modern phone cameras on iOS and many Android scanners will read inverted codes. ZXing, by default, will not, and plenty of older, embedded and point-of-sale scanners cannot either. So an inverted code is a gamble: it might work on the device in your hand and fail on a third of the devices in the wild. For agency work, where you cannot control which scanner a member of the public uses, keep modules darker than the background and you remove the gamble entirely.

This is closely related to why a code can fail for reasons that have nothing to do with colour. If you are chasing a code that will not scan at all, our guide on why a QR code is not scanning covers the other usual suspects.

What the real contrast numbers are

Here is where the internet does you a disservice. Several different "minimum contrast" numbers circulate, and they come from different standards measuring different things, so quoting one without context is meaningless. Let us separate the hard facts from the rules of thumb.

  • Black on white is about 21:1 on the WCAG contrast scale. This is the safe baseline everyone benchmarks against, and it scans in almost any condition. This is a hard fact.
  • Denso Wave recommends a contrast ratio of at least 2.0:1, and reports that even colour-inverted codes read fine at that level. This comes from the inventor, so treat it as a hard floor, not a target.
  • Independent phone testing suggests roughly 2:1 is a realistic practical floor: at 2:1 most devices pass, between 1.5:1 and 1.9:1 some apps start failing, and below about 1.3:1 scanning is unreliable. This is empirical, so call it a rule of thumb.
  • Many design guides cite "minimum 3:1, prefer 4:1" and attribute it to ISO. Be careful here: that 4:1 figure is best-practice advice, and it looks suspiciously like the WCAG text contrast number (which is about humans reading words, not machines reading codes). It is not a literal QR specification.

So what should you actually do? Do not aim for the floor. Aim high. The honest framing is: maximise the luminance difference, treat black-on-white (21:1) as your reference, and keep a comfortable margin so the code survives bad printing, bad light and old cameras. A dark brand colour on a white or very light background will usually clear any of these thresholds with room to spare. A mid-tone on a mid-tone will not.

Beware one specific myth: there is no credible source for "X per cent of coloured QR codes fail to scan" statistics, and "ISO mandates 4:1" is not accurate. ISO/IEC 18004 governs how the code is encoded; print quality is graded separately under ISO/IEC 15415, which measures symbol contrast as a percentage, not as a 4:1 ratio.

Colours that quietly sabotage you

Some colour choices fail for reasons you would never guess from looking at them on screen.

Red and orange foregrounds are the classic trap. Many conventional barcode scanners (the kind at retail tills) illuminate with a red LED at around 660 nanometres. Denso Wave warns that if both the background and the code reflect or absorb red, the scanner cannot tell them apart. Red ink reflects red light, so to a red-illuminated scanner a red module on white paper can look as bright as the paper itself: zero contrast, no read. Even to a normal colour phone camera, saturated red on white sits at only around 4:1, which is borderline. Avoid red modules on light backgrounds.

Low-contrast pastels (light blue, yellow, light green as the foreground) fail because the brightness gap falls below the binarisation threshold. They look gentle and on-brand and they do not scan.

Gradients are risky whenever they approach the background brightness somewhere across the code. A dark-navy-to-slightly-less-dark-navy gradient on white is usually fine; a gradient that fades towards a pale tone will cross the local threshold and drop modules. Keep gradients dark-to-dark and well clear of the background.

Metallic, foil and reflective inks cause a different problem: specular glare. A bright reflection blows out the camera's exposure in patches and destroys local contrast exactly where the highlight lands. They photograph beautifully and scan badly, especially on packaging under shop lighting.

If your goal is to get a logo or brand mark into the code rather than just colour it, that is a separate skill with its own rules. See putting a logo in a QR code without breaking the scan.

Error correction is not a contrast fix

There is a tempting shortcut: "I will just crank the error correction level up to H and then my low-contrast colours will be fine." It does not work that way, and the distinction matters.

QR error correction (levels L, M, Q and H, recovering roughly 7, 15, 25 and 30 per cent of codewords respectively) uses Reed-Solomon coding to recover modules that are missing, damaged or covered: a scratch, a smudge, a logo sitting on top. It does not compensate for global low contrast. If the whole image cannot be binarised cleanly, the decoder cannot reliably read the modules in the first place, so there is nothing for the error correction to work on. Low contrast is not damage. High error correction tolerates occlusion, not muddiness.

Worse, raising the error correction level adds more modules, which makes each module smaller at a given print size, which can reduce readability if the code is printed small. Pick the level for the right reason: use H when you are overlaying a logo or printing somewhere it will get worn, and use L or M for clean indoor use. We go deeper in our guide to QR code error correction levels.

A colour that scans perfectly on screen can fail in print, because screens and presses build colour in opposite ways. Screens are additive RGB; print is subtractive CMYK. When your nice on-screen colour is converted to CMYK, it can shift, and the shift can drop contrast below the scanning threshold. Convert to CMYK before sending to print, then re-check the contrast on the converted version, not the screen version.

Two specific print rules earn their place:

  • Use plain black for the modules: CMYK (0, 0, 0, 100), not "rich black". Rich black layers cyan, magenta and yellow under the black, which causes misregistration and ink bleed where the plates do not line up perfectly. Bled edges blur the boundary between module and background, exactly the boundary the scanner depends on. Pure 100 per cent black gives clean, high-contrast modules.
  • Account for the actual paper and finish. Cream, kraft or coloured stock lowers the background brightness and shrinks your contrast. Glossy or laminated finishes add glare. The white preview on your monitor is not the surface your code will live on.

Export print codes as vector (SVG or PDF) so the module edges stay crisp at any size. Our full print preparation guide covers vector, CMYK and resolution in more detail.

Do not forget the quiet zone

The quiet zone is the clear margin around the code, and ISO/IEC 18004 requires it to be four modules wide on all sides. It is not optional decoration; it is how the scanner locates the edges of the symbol. Two colour mistakes happen here. First, people tint the quiet zone or let a coloured background bleed into it, which kills the contrast the scanner needs to find the code. Second, people drop the code onto busy artwork with no clear margin at all. The quiet zone must stay the same light, high-brightness colour as the code's background. Branded artwork belongs outside it, not inside.

Test like your client's customers will

The single most useful habit is to test the final rendered or printed asset, not the design file, across real devices. Specifically:

  • Test on both iOS and Android, including at least one older phone, not just the newest one in the studio.
  • Test with the native camera app as well as a dedicated scanner app, because they tolerate low contrast and inverted codes differently.
  • Test in realistic light, including dim and angled conditions, not just under studio lighting.
  • Test at the smallest size and greatest distance the code will really be used at. Contrast and size interact; a marginal-contrast code that scans large can fail small. See how big a QR code should be.

For a large or high-stakes print run, proof on the actual substrate, and if the budget allows, run an ISO/IEC 15415 verifier, which grades symbol contrast objectively instead of relying on your eye.

There is also an accessibility angle worth keeping in view: high contrast helps people with low vision locate and aim at the code too, not just the scanner. Our QR code accessibility guide covers placement, size and contrast for human readers.

Frequently asked questions

Can a QR code be any colour?

Almost. The modules can be any colour that is clearly darker than the background, and the background can be any colour that is clearly lighter than the modules. What you cannot do safely is invert the code (light on dark), use a foreground that is not meaningfully darker than the background, or use red modules on a light background. Keep the brightness difference high and you have plenty of room.

What colour should a QR code be for the best scan rate?

Dark modules on a light background, ideally black on white, which sits at roughly 21:1 contrast and scans in almost any condition. If you need brand colour, use a dark, saturated brand tone (a deep navy, forest green or charcoal) on white or a very light tint, and keep well clear of the minimum thresholds.

Why does my coloured QR code not scan?

The most common cause is insufficient brightness contrast between the modules and the background: a mid-tone on a mid-tone, a pastel foreground, or an inverted (light-on-dark) code. Red or orange modules are another frequent culprit because red-light scanners cannot distinguish them from a light background. Print shifts (RGB to CMYK), glossy glare and a tinted quiet zone also break otherwise valid codes.

Can a QR code be white on black (inverted)?

Sometimes, but it is a gamble. Inverted codes are not part of the required QR specification, so support depends entirely on the scanner. Modern phone cameras often read them; ZXing by default and many older or point-of-sale scanners do not. For anything public-facing, keep the modules darker than the background.

Does a higher error correction level fix low contrast?

No. Error correction recovers modules that are missing, damaged or covered, not a code that is too low-contrast to binarise in the first place. Contrast is a separate problem from damage. Fix the contrast; do not lean on error correction to rescue a muddy colour scheme.

Why should I avoid red QR codes?

Many barcode scanners illuminate with a red LED, and red ink reflects red light, so a red module on white paper can appear as bright as the paper to the scanner: no contrast, no read. Red on white is also only around 4:1 even to a colour camera, leaving little margin. If red is essential to the brand, use it in artwork around the code, not for the modules themselves.

The short version

A QR code can carry your brand colours, but only because scanners read brightness, not colour, and only if you keep the modules clearly darker than the background. Black on white (around 21:1) is the safe reference; Denso Wave's 2:1 is the floor, not the target, so aim well above it. Avoid red and orange foregrounds, low-contrast pastels, fading gradients, metallic inks and inverted codes. Do not expect error correction to rescue low contrast, convert to CMYK and re-check before printing, keep the quiet zone clean, and test the final asset on real devices at the real size. Brand the code, then prove it scans before it goes anywhere near a client's print run.

Share

Keep reading