Printing Guide

Best Colors for QR Codes That Still Scan

A black-and-white QR code scans perfectly, but it does not match most brands. Colored QR codes are a simple way to make your codes look intentional rather than generic. The trick is choosing colors that look good without sacrificing scannability.

Why Color Matters for Scanning

QR scanners work by detecting contrast — the difference in brightness between the dark modules and the light background. The scanner does not care about the specific colors, only about how different they are in terms of luminance (perceived brightness).

This means:

  • Dark blue modules on white background → works great (high luminance contrast)
  • Yellow modules on white background → fails (both are high luminance, low contrast)
  • Dark green modules on black background → fails (both are low luminance)

The Contrast Rule

Before choosing colors, check the luminance contrast ratio. You can calculate this with any web accessibility contrast checker (WCAG tools work for this purpose).

Contrast RatioScan Reliability
21:1 (black on white)Perfect — maximum reliability
7:1 and aboveExcellent — works on virtually all devices
4:1 to 7:1Good — works on most modern devices
3:1 to 4:1Risky — may fail on older devices or in poor lighting
Below 3:1Unreliable — do not use

Colors That Work Well

Dark Modules on Light Background

This is the natural orientation that all scanners are optimized for.

Safe module colors on white or light background:

  • Black (#000000) — maximum contrast, always works
  • Dark navy (#1a1a2e, #0d1b2a) — professional, nearly as reliable as black
  • Dark green (#064e3b, #14532d) — works well, feels fresh
  • Dark purple (#4c1d95, #581c87) — on-brand for many tech products
  • Dark brown (#3e2723, #4a2c2a) — warm, works for food and craft brands
  • Dark red (#7f1d1d, #991b1b) — bold, but test carefully

Safe background colors behind dark modules:

  • White (#ffffff) — maximum contrast
  • Light gray (#f5f5f5, #e5e7eb) — subtle, nearly as good as white
  • Light cream (#fefce8, #fef3c7) — warm alternative to white
  • Light blue (#eff6ff, #dbeafe) — soft, modern feel

What to Avoid

  • Yellow modules on any light background — yellow has high luminance, meaning it appears bright to cameras even though it looks colored to human eyes
  • Red or orange modules — phone camera sensors (Bayer filter) are least sensitive to red wavelengths, making red modules harder to detect than they appear to the human eye
  • Pastel modules on white — light pink, light blue, light green on white all have dangerously low contrast
  • Dark modules on dark background — dark blue on dark gray, dark green on black, etc.

Inverted QR Codes (Light on Dark)

You can create QR codes with light-colored modules on a dark background. This looks striking and fits dark-themed designs well.

However:

  • Not all scanners handle inverted codes reliably
  • Older phones and some third-party scanner apps expect dark-on-light
  • The built-in camera scanner on most modern iPhones and Android phones handles inverted codes, but it is not universal

If you use inverted colors:

  1. Test on at least five different devices including older models
  2. Keep contrast at 7:1 or higher
  3. White modules on dark background is safest (highest contrast)
  4. Have a fallback plan if testing reveals compatibility issues

Brand Color Integration

To match your brand without risking scannability:

Method 1: Colored Modules

Use your darkest brand color for the modules on a white or very light background. This is the safest approach.

Example: If your brand uses blue (#2563eb), that is too bright for modules. Use your brand’s dark navy (#1e3a5f) instead and save the bright blue for the frame or surrounding design. If you are also adding a logo, keep the modules even darker to compensate for the lost data area.

Method 2: Colored Background

Keep modules black or very dark, and use a light tint of your brand color as the background.

Example: Brand green (#22c55e) → use a very light green background (#f0fdf4) with black modules. The code scans perfectly and has a branded feel.

Method 3: Branded Frame

Keep the QR code itself in high-contrast black and white, then surround it with a branded frame in your brand colors. This is the zero-risk option that still looks polished.

Testing Colors

After choosing your colors:

  1. Check contrast ratio using a WCAG contrast checker
  2. Generate a test QR code with your chosen colors
  3. Scan on multiple devices — at least one iPhone, one Android, one older model
  4. Test in different lighting — bright office, dim room, outdoors
  5. Print a test if the code will be printed — screen colors and print colors differ

If any test fails, increase the contrast by darkening the modules or lightening the background. Small adjustments often solve the problem without changing the overall aesthetic.

Dark Mode Considerations

If your QR code appears on a website with dark mode, ensure it works in both themes:

  • Wrap the QR code in a container with a fixed light background
  • Do not let the QR code inherit the page’s dark background color
  • Or generate two versions (dark-on-light and light-on-dark) and swap with CSS

A QR code that works in light mode but breaks in dark mode will frustrate users who browse at night.

Create a Colored QR Code

Open QR Generator →

Frequently Asked Questions

Can I use a white QR code on a dark background?

Yes, inverted QR codes (light modules on dark background) can work, but they are less universally compatible. Some older devices and third-party scanner apps struggle with inverted codes. Always test on multiple devices before committing to an inverted design.

What is the minimum contrast ratio for a scannable QR code?

Aim for at least a 4:1 contrast ratio between modules and background. For maximum reliability across all devices, a 7:1 ratio or higher is recommended. Black on white provides roughly 21:1.

Can I use a gradient in my QR code?

Gradients on the background are generally safe if the lightest part still provides enough contrast with the modules. Gradients on the modules themselves are risky because parts of the gradient may not contrast sufficiently with the background.

Related Guides