QR code colors that actually scan.

Can a QR code be any color? Contrast rules, colors that fail on real phones, inverted codes, gradients and brand palettes, explained with examples.

Updated December 3, 2026 · By the VisualQR team

Short answer A QR code can be almost any color as long as the code is clearly darker than its background. Aim for a contrast ratio of at least 4:1, like navy, deep green or burgundy on white or cream. Avoid yellows, pastels, light grays and mid-tone oranges for the code itself, and test light-on-dark (inverted) codes before printing.

What scanners actually see

A phone camera doesn’t read a QR code by hue. The decoder turns the image into light and dark, then decides which squares are dark modules and which are background. Color only matters because it changes how light or dark something looks. A bright red and a mid gray can look almost identical once the color is stripped out.

That gives you one rule that covers almost every case: the code must be clearly darker than the background. Get that right and you’re free to use your brand colors, gradients and custom shapes.

Contrast ratios that work

Contrast ratio measures the difference in lightness between two colors, from 1:1 (identical) to 21:1 (black on white). It’s the same measure used for readable text on websites, and it maps well to how reliably a code scans.

Contrast ratioWhat to expect
7:1 and aboveExcellent. Scans in dim light, at angles and from a distance.
4:1 to 7:1Good. Fine for nearly all print and screens.
2.5:1 to 4:1Risky. Often scans on a good phone in good light, fails in real conditions.
Below 2.5:1Likely to fail. Many phones won’t find the code at all.

The VisualQR generator measures this as you design. It warns you at “Low contrast” and turns red at “Colors are too similar to scan reliably”, using the same thresholds.

Real color examples on white

Code colorHexContrast on whiteVerdict
Black#00000021:1Perfect
Navy#1a2b5c13.6:1Excellent
Electric blue#3d2bf57.3:1Excellent
Forest green#2f6b4a6.3:1Good
Brick red#d12d2d5.1:1Good
Raspberry#e0115f4.8:1Good
Bright orange#ff4f1f3.3:1Risky
Mid gray#8f8f8f3.2:1Risky
Sky blue#00a3e02.9:1Risky
Light gray#b8b8b82.0:1Fails
Golden yellow#e8c9001.6:1Fails

Notice that bright, saturated colors like orange and sky blue feel bold but are actually light. If your brand color sits in the risky band, use a darker shade of it for the code and save the bright version for the frame, the logo or the background.

Colored backgrounds

The background doesn’t have to be white. Cream, pale pink, mint, light blue and lime all work beautifully, as long as the code on top is dark. Black on a lime green like #d9f85a is over 16:1. A dark green on pale sage is over 11:1.

Two things to watch:

  • Mid-tone backgrounds. A medium blue or a strong red background leaves no room for a dark enough code. Put a light panel behind the code instead.
  • Busy backgrounds. Photos, patterns and textures confuse scanners because they add random light and dark spots. Give the code a solid tile with a clear margin around it.

Light on dark (inverted) codes

A white code on a black background looks sharp, and modern iPhone and Android cameras usually scan it. But inverted codes were not part of the original design, and some older phones, scanner apps and payment terminals don’t try to read them.

Use inverted codes only when you control the audience or can test widely, like a design-literate event crowd. For a menu, a parcel label or anything aimed at the general public, stick with dark on light. If your layout is dark, put the code on a light tile.

Gradients, multicolor codes and corner colors

Gradients and multicolor palettes work well when every color in them passes the contrast test. Judge a gradient by its lightest point, not its average. A fade from black to deep purple is safe. A fade from navy to sky blue gets risky where it turns light.

The three large corner squares (finder patterns) are what a phone looks for first. You can color them differently from the rest of the code, which is a great way to add a brand accent. Because they are big, solid shapes, scanners find them with a little less contrast than the small data modules. Still keep them clearly darker than the background.

Tip: Squint at your design from across the room. If the code melts into the background, a phone in a dim restaurant will struggle too.

Print changes colors

Colors on screen are brighter than ink on paper. A code that looks crisp on your monitor can print muddier and lighter, especially on uncoated paper and in four-color (CMYK) printing. Pick colors with headroom, around 7:1 or better for small codes, and ask your printer for a proof. For small codes, printing the code in a single solid ink avoids tiny color misalignments between plates. The print guide covers this in more detail.

A quick color checklist

  1. Code darker than the background, every part of it.
  2. Contrast of 4:1 or more, 7:1 or more for small or printed codes.
  3. No yellows, pastels or light grays for the code.
  4. Solid, calm background with a clear margin.
  5. Inverted only if you’ve tested it with the phones your audience uses.
  6. Test a real print in real light.

The custom QR code generator lets you try any color, gradient or palette for free and warns you live when contrast drops. When you’re done, press “Test how it scans” to check the design against dim light and glare, or upload a photo of an existing code to the QR code tester.

Questions

Quick answers.

Can’t find what you need? Every answer here is honest, including the boring ones.

Can a QR code be any color?

Almost. The code just needs to be clearly darker than its background, with a contrast ratio of about 4:1 or more. Navy, deep green, burgundy, purple and dark brown all work. Yellow, pastels and light gray do not.

Does a QR code have to be black and white?

No. Black on white has the most contrast, but any dark color on any light background scans well. Gradients and multicolor designs work too, as long as every color is dark enough.

Will a white QR code on a black background scan?

Usually, on modern iPhone and Android cameras. Some older phones, scanner apps and terminals don’t read inverted codes, so use dark on light for anything aimed at the general public.

Why won’t my yellow or orange QR code scan?

Bright yellows and oranges look bold but are light. Once a scanner converts the image to light and dark, the code blends into a white background. Use a darker shade of the color for the code.

Can the corner squares be a different color?

Yes. The three corner squares can have their own color, which is a nice way to add a brand accent. Keep them clearly darker than the background so phones can still find the code.

Make one now. It’s free.

No sign-up, no watermark, no catch. Just a QR code you’ll actually want to print.

Start creating