Do QR Codes Have to Be Black and White?

Which colors scan, why white and inverted codes are risky, and how to test before you print.

No, QR codes don't have to be black and white. Any colors work as long as the code is clearly darker than its background. A phone reads a QR code by the difference in light reflected from the dark and light squares, so contrast matters, not color. Denso Wave, the company that invented the QR code, still recommends black on white as the safe default (Denso Wave FAQ).

Color is a design choice. Contrast is a scanning requirement.

Colors that scan and colors that don't

Here are six versions of the same code. The ratio is the contrast between the code and its background, calculated with the standard WCAG formula (21:1 is the maximum).

SampleColorsContrastVerdict
Black QR code on whiteBlack on white21:1Safest choice
Dark green QR code on creamDark green on cream8.5:1Scans well
Violet QR code on whiteViolet on white5.7:1Scans well
Cyan QR code on whiteCyan on white2.4:1Risky
Yellow QR code on whiteYellow on white1.5:1Fails
White QR code on blackWhite on black (inverted)21:1Risky, see below

Violet and cyan are both QRZY brand colors. Only the violet makes a reliable code. Brand colors aren't automatically safe; check the contrast.

How much contrast is enough? There's no single agreed number for phone scanning. Accessibility guidance gives a useful floor: the DAISY Consortium recommends that QR codes at least meet WCAG's non-text contrast rule (DAISY Knowledge Base), which is a 3:1 ratio. The US government's Section 508 guidance asks for at least 4.5:1 (Section508.gov). Aim for 4.5:1 or more, and test.

Colors to avoid for the code itself:

  • Red. Denso Wave says a red code on a white background can't be read.
  • Yellow, orange and other light colors on white. QR Code Generator's guide warns against "yellow on white" for the same reason.
  • Light grey and pastels: a light grey such as #D1D5DB on white has the same 1.5:1 contrast as the yellow example above.

Can QR codes be white?

A white code on a black background, called an inverted QR code, has the same contrast as black on white. Some phone cameras read it, but neither Apple nor Google documents support for it, and not every scanner does: GS1 New Zealand advises against inverted codes because traditional scanners read the darker color as the code (GS1 NZ).

  • On posters and packaging where anyone might scan it with any phone or app, use dark on light.
  • If the design needs a dark background, put the code on a white panel instead of inverting it.
  • If you do invert it, test with several phones and apps before you print.

Transparent backgrounds

A transparent PNG or SVG takes on whatever is behind it. Put a dark code on a dark wall, a photo or a clear sticker and the contrast disappears. Denso Wave's advice for printing on transparent bags is to print a white background as well as the black squares.

  • Export with a solid light background, not a transparent one.
  • On photos, patterns or colored packaging, place the code on a plain light panel.
  • Keep the white border (the quiet zone) part of that panel.

Color and accessibility

Strong contrast also helps people with low vision or color blindness find and scan the code, which is why accessibility guidance asks for it. A code that's easy for everyone to see is easy for every phone to read.

How to set QR code colors in QRZY

QRZY lets you pick both colors for every code:

  • When you create a code: in the Customize Design step, set Foreground Color and Background Color.
  • On an existing code: open it, click Edit, and go to 3 · Customize to change Foreground and Background, then download the code again.
  • In the free generator: the free QR code generator has the same two color pickers, with no sign-up.

Matching your brand is crazy simple: paste your brand's hex code. Then check the contrast yourself, because QRZY doesn't check contrast for you and won't stop you from picking a light color.

Color changes apply to new downloads, not to codes you've already printed. A color mistake in print means a reprint. A wrong link doesn't: every QRZY dashboard code is dynamic, so you can change where it points after printing. See how dynamic QR codes work.

Test before you print

  1. Print one copy at the final size and color, on the final material.
  2. Scan it with an iPhone and an Android phone, in the light where it will hang.
  3. If either phone hesitates, darken the code or lighten the background.

Size matters as much as color. Check the QR code size guide, and if a printed code fails, the not-scanning checklist walks through every cause. Brand colors on shop signage are a common case: see QR codes for retail stores. For placement and error correction, see the QR code best practices.

Frequently asked questions

Do QR codes have to be black and white?

No. Any dark color on a light background works if the contrast is high enough. Black on white is the safest.

Can a QR code be white?

Yes, as an inverted code on a dark background, but not every scanner reads it. For print, a dark code on a white panel is safer.

Can a QR code have a black background?

Only with a light code, which makes it an inverted code. Some phones read those; some scanners don't. Test before printing.

What colors don't work for QR codes?

Red, yellow, orange, light grey and pastels on white, and any dark code on a dark background.

Can a QR code have a transparent background?

It can, but the code then depends on whatever is behind it. Use a solid light background for print.

Related reading

QR Code Size for Print

Minimum sizes by scanning distance, and why short links print smaller.

Read More →

QR Code Not Scanning?

Find whether the phone, the print or the link is the problem.

Read More →

QR Code Best Practices

Placement, error correction and testing before you print.

Read More →

Create a QR code in your brand colors

Free plan includes one dynamic code. No credit card.

Get Started Free