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 ratio | What to expect |
|---|---|
| 7:1 and above | Excellent. Scans in dim light, at angles and from a distance. |
| 4:1 to 7:1 | Good. Fine for nearly all print and screens. |
| 2.5:1 to 4:1 | Risky. Often scans on a good phone in good light, fails in real conditions. |
| Below 2.5:1 | Likely 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 color | Hex | Contrast on white | Verdict |
|---|---|---|---|
| Black | #000000 | 21:1 | Perfect |
| Navy | #1a2b5c | 13.6:1 | Excellent |
| Electric blue | #3d2bf5 | 7.3:1 | Excellent |
| Forest green | #2f6b4a | 6.3:1 | Good |
| Brick red | #d12d2d | 5.1:1 | Good |
| Raspberry | #e0115f | 4.8:1 | Good |
| Bright orange | #ff4f1f | 3.3:1 | Risky |
| Mid gray | #8f8f8f | 3.2:1 | Risky |
| Sky blue | #00a3e0 | 2.9:1 | Risky |
| Light gray | #b8b8b8 | 2.0:1 | Fails |
| Golden yellow | #e8c900 | 1.6:1 | Fails |
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
- Code darker than the background, every part of it.
- Contrast of 4:1 or more, 7:1 or more for small or printed codes.
- No yellows, pastels or light grays for the code.
- Solid, calm background with a clear margin.
- Inverted only if you’ve tested it with the phones your audience uses.
- 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.