Quick answer
QR codes work in almost any color as long as the code is dark, the background is light and the contrast between them is strong. KeptLink requires a contrast ratio of at least 4.5:1. Avoid light code colors like yellow or pastels, check the lightest part of any gradient, and be careful with light-on-dark codes.
On this page
You don’t have to settle for a black-and-white QR code. Brand colors can make a code look like part of your design instead of an afterthought. The trick is knowing which color choices a phone camera can handle and which ones quietly make the code harder to scan.
The one rule: dark code, light background
A phone reads a QR code by telling the dark modules apart from the light background. Everything about choosing colors comes back to that.
- The code (the dots) should be dark. Black, navy, charcoal, forest green, deep burgundy and dark purple all work.
- The background should be light. White is best. Cream, very light gray or a very pale tint of your brand color can work too.
- The difference between them should be large. Two colors that look distinct to you can still be too close in brightness for a camera.
If you remember nothing else, remember this: a dark code on a light background, with plenty of difference between them.
Contrast ratio, in plain terms
Contrast ratio is a number that compares how bright two colors are. It runs from 1:1 (identical) to 21:1 (black on white). It’s the same measure web designers use to check that text is easy to read.
KeptLink blocks designs with a contrast ratio below 4.5:1, so you can’t download a code that’s likely to fail because of its colors. Passing that bar is the minimum, not the goal. More contrast gives you more room for dim lighting, glare and imperfect printing.
| Usually works | Usually risky |
|---|---|
| Black on white | Yellow on white |
| Navy on white | Light gray on white |
| Dark green on cream | Pastel colors on white |
| Dark red on white | Orange on white |
| Deep purple on pale lavender | Any light code on a dark background |
Brightness matters more than hue. A bright red and a bright green can look very different to you and still be too close in brightness for a camera to separate.
Gradients and brand colors
Gradients can look great, but each end of the gradient has to pass the contrast test on its own. A gradient that runs from navy to a light sky blue might look fine overall, while the light end fades into the background.
That’s why KeptLink checks contrast at the lightest point of a gradient, not the average. If that point is too light, pick a darker second color.
Some other ways to bring in brand colors safely:
- Color the corner squares (the eyes). The three large corner squares can have their own color. A darker shade of your brand color there adds personality. The corners count toward the contrast check too, so they still need to be dark against the background.
- Use a frame. A frame with call-to-action text, like “Scan for the menu”, can carry your brand color without touching the code.
- Start from a template. Our 10 design templates are a quick way to try styles, and you can adjust colors from there.
If you’re adding a logo too, keep the code colors especially strong. Our guide on adding a logo to a QR code explains why.
Inverted codes (light on dark)
An inverted code has light modules on a dark background, like a white code on a black poster. It can look sleek, but some phone cameras can’t read inverted codes at all, and you can’t know which phones your customers carry.
KeptLink lets you make one but shows a warning. If the code is going on anything important, like a menu, a sign or packaging, use a dark code on a light background instead. On a dark design, place the code on a white or light panel with its white border around it.
Colors on paper
Colors on your screen and colors on paper are not the same. Printed colors can come out darker, lighter or duller than they look on a monitor, and that can shrink the contrast you thought you had.
- Keep the light border. The quiet zone around the code should stay light, so don’t print the code straight onto a dark or busy background.
- Watch the paper. Colored or textured paper changes how the background looks. White or light paper is safest.
- Beware of shine. Glossy finishes, lamination and metallic inks can reflect light and hide parts of the code.
- Print a test. The live scan check in the generator reads the code on your screen. Print one copy at the final size and scan it with a couple of phones before ordering a full run.
For sharp printed colors, use an SVG or PDF file. Our guide to SVG vs PNG vs PDF explains which to pick. Ready to try? Open the website QR code generator and experiment. The contrast check will tell you right away if a color won’t work.
Frequently asked questions
Can a QR code be any color?
Almost. The code needs dark modules on a light background with strong contrast between them. Navy, dark green, deep purple or dark red on white all work well. Yellow, pastel or light gray codes usually don't.
What contrast ratio does a QR code need?
KeptLink requires at least 4.5:1 between the code color and the background, the same measure used for readable text on websites. Black on white is 21:1. Higher is safer, especially for print.
Do white-on-black QR codes work?
Some phones read them, but some phone cameras can't read inverted (light-on-dark) codes at all. If everyone needs to be able to scan it, use a dark code on a light background.
Can I use a gradient in a QR code?
Yes, as long as every part of the gradient stays dark enough against the background. KeptLink checks contrast at the lightest point of the gradient, because that's where a scan is most likely to fail.