QR Code Colors: Rules for Colored QR Codes

A QR code can be any colour as long as the code is clearly darker than its background, with a contrast ratio of at least 4:1. This guide lists which colour pairs scan, which fail, why inverted codes cause trouble, and how to test a coloured code before printing.

Updated Β· QRJiffy team

A QR code with red corner squares printed on a gallery wall
Coloured corner squares keep a code on-brand; dark modules on a light background keep it scannable. Photo: TANNMY NAISZE Wanguo Β· CC0 Β· Wikimedia Commons

Can QR codes be colored?

Yes, QR codes can be any colour, because scanners read light and dark contrast, not hue. A phone camera converts the image to greyscale and sorts each module into dark or light. A navy, burgundy or forest-green code on a white background scans as reliably as a black one β€” try any colour in the QR code designer, which warns you when contrast is too low. The QR code standard (ISO/IEC 18004) defines modules only as β€œdark” and β€œlight”.

Do QR codes have to be black and white?

No, QR codes do not have to be black and white; they need a dark code on a light background. Black on white gives the highest contrast (21:1), so it remains the safest choice for small prints, long-distance scans and low light (see the QR code size guide for print sizes). Brand colours work when they keep enough contrast with the background.

How much contrast does a QR code need?

A QR code needs a contrast ratio of at least 4:1 between code and background, and 7:1 or more for small or distant codes. The ratio is the same WCAG luminance ratio used for text accessibility, and low contrast is one of the top reasons a QR code is not working. The table compares common colour pairs.

We tested 22 colour pairs in our scan tests, 20 simulated phone photos each, in good and dim light:

Colour pairs tested: share of photos that decoded
Code on backgroundContrast ratioGood lightDim light
Black
#000000 on #ffffff
21:1100%90%
Black on cream
#111827 on #fef3c7
15.9:1100%85%
Navy
#1e3a8a on #ffffff
10.4:1100%75%
Dark green
#14532d on #ffffff
9.1:1100%70%
Navy on light blue
#1e3a8a on #bfdbfe
7.3:1100%50%
Black on mid grey
#111827 on #9ca3af
7:1100%20%
Brand violet
#5b4bf5 on #ffffff
5.6:1100%30%
Red
#dc2626 on #ffffff
4.8:1100%50%
Blue
#3b82f6 on #ffffff
3.7:1100%5%
Orange
#f97316 on #ffffff
2.8:180%0%
Pink
#f472b6 on #ffffff
2.6:130%0%
Yellow
#facc15 on #ffffff
1.5:10%0%

Every pair at 4:1 or more decoded in good light, but dim light separated them: black on white held at 90%, while a black code on a mid-grey background, at 7:1, fell to 20%. Coloured and grey backgrounds lose the most when light is poor, so keep the background white for menus and signs in bars and restaurants.

Do inverted QR codes work?

Inverted QR codes, with a light code on a dark background, scan only when the scanner runs an extra inverted pass. The standard defines dark modules on a light background. In our tests both decoders read an inverted code 100% of the time with that pass switched on and 0% with it off. Whether a given phone or app runs the pass varies, so keep the code dark and the background light for print.

Which QR code colors do not scan?

Light colours on white, colours with similar brightness, and red codes scanned under red light do not scan. Pairs that fail most often:

  • Pastels on white, for example light pink, light blue or yellow.
  • Two saturated colours of similar brightness, for example red on green or blue on purple.
  • Any code printed on a busy photo or pattern without a solid quiet zone.
  • Red codes in venues lit with red light, such as bars and darkrooms.

Can the finder patterns be a different color?

Yes, the three corner finder patterns can use a separate colour if they keep the same dark-on-light contrast. Colouring only the finder patterns adds brand colour while the data area stays high-contrast. Keep the 4-module quiet zone around the code in the background colour.

How do you test a colored QR code?

Test a coloured QR code by printing it at final size and scanning it with 3 phones in the lighting where it will hang. Steps:

  1. Print a proof on the real material, because ink on coloured paper is darker or lighter than the screen.
  2. Scan with an iPhone Camera, an Android Camera and Google Lens.
  3. Scan from the expected distance and at a 30Β° angle.
  4. Repeat under dim light; switch to a darker code colour if any scan takes over 2 seconds.

The QR code generator with logo previews colour choices live, so you can check contrast before you download.

Pick a code colour and background in the free QRJiffy QR code generator, then download the code as SVG for print.

Frequently asked questions

Can a QR code have a gradient?

Yes, a gradient works when every part of it stays dark against the background. A gradient that fades into a light colour drops below the contrast a phone camera needs and breaks the scan in that area.

Can a QR code be printed in gold or silver foil?

Metallic foil scans poorly. Foil reflects light at the camera, so dark modules flash bright at some angles; print the code in flat ink and use foil around it instead.

Can I make a transparent QR code?

A QR code with a transparent background works only on a light, plain surface. On a photo or a dark surface the background shows through and the code loses its contrast, so export it with a solid light background.

Sources

  1. QRJiffy QR code scan tests β€” our own reproducible tests with two open-source decoders
  2. WCAG 2.1 β€” definition of contrast ratio β€” W3C
  3. Point for determining the code area (quiet zone) β€” DENSO WAVE (QRcode.com)
  4. ISO/IEC 18004:2024 β€” QR Code bar code symbology specification β€” ISO