QR code colors: how far you can go

A QR code does not have to be black on white. It does have to be dark on light, with plenty of contrast — and a few popular colour choices quietly break it.

Short answerYes, a QR code can be coloured, as long as the modules are darker than the background and the contrast between them is strong: dark blue, green, or burgundy on white or cream usually scan well. Avoid inverted codes (light on dark), low-contrast pairs such as yellow on white, and busy or gradient backgrounds, and test the result on several phones.

What a scanner actually needs

A phone does not see colour when it reads a QR code. It converts the image to brightness and decides, module by module, whether each square is dark or light. Hue is irrelevant; the only thing that matters is how far apart the two brightness levels are, and which one is which.

That gives two rules. First, the modules must be the dark part and the background the light part, because that is the arrangement the standard describes and the one every reader expects. Second, the gap between them must survive real conditions: glare, shadow, a cheap printer, a camera that adjusts its exposure to the whole scene rather than the code.

Black on white maximises both, which is why it is the reference case. Every colour change spends some of that margin. Spending a little is fine; spending most of it produces a code that scans in the office and fails at the venue. How the reader samples modules is explained in how QR codes work.

Colour pairs that work and pairs that fail

Common foreground and background combinations
Modules on backgroundResultWhy
Black on whiteReliableMaximum contrast; the reference case.
Navy, dark green, or burgundy on whiteUsually reliableStill very dark against a very light ground.
Dark grey on cream or pale greyUsually reliableFine if the background stays genuinely pale.
Mid blue or orange on whiteMarginalToo light to separate cleanly in poor light.
Red on blackFails oftenBoth read as dark once converted to brightness.
Yellow or light grey on whiteFailsBoth read as light.
Pastel on pastelFailsAlmost no brightness difference at all.
White on black (inverted)Fails on some readersDark and light are swapped from what the standard expects.

A useful check: convert your design to greyscale. If the code still looks like a crisp black-and-white pattern, it will probably scan. If it looks like two shades of grey, it will not.

Inverted codes

Light modules on a dark background look striking and are popular on dark-themed packaging and slides. Many modern camera apps read them, but some readers do not, and you cannot choose which reader your audience uses. If the design demands a dark panel, put a white box inside it and place a normal dark-on-light code in that box, quiet zone included.

Gradients, patterns, and transparency

  • Gradients across the modules. A gentle gradient between two dark colours can work. One that fades towards a light colour leaves part of the code with too little contrast, and a scanner needs all of it.
  • Patterned or photographic backgrounds. Texture behind the code adds noise exactly where the scanner looks for clean light modules. Keep the code and its quiet zone on a flat, plain area.
  • Transparent backgrounds. If you remove the white background from the file, the light modules become whatever is behind them. On white paper that is fine; dropped onto a dark photo or a coloured panel, the code may invert or vanish. Keep an opaque light background behind the code.
  • Finishes. Metallic inks, foils, and gloss laminates reflect light into the camera and can wash out contrast that looked fine on screen.

The quiet zone must be the same light colour as the code’s background. A coloured border pressed up against the modules is read as part of the symbol and confuses the reader about where the code starts.

Choosing colours on this site

The generator here starts from black modules on a white background, the combination that scans on the widest range of phones. The custom QR code generator lets you pick a foreground and a background colour, and it enforces the rules above: the foreground must be the darker of the two, the contrast ratio must be at least 4.5:1, and inverted codes are refused. The PNG and SVG downloads both carry the colours you chose.

You can also download the SVG and recolour the modules in a design tool such as Illustrator, Affinity, Inkscape, or Figma — useful for an exact print colour. Because the code is made of plain vector shapes, changing the fill is a single step, but nothing then checks the contrast for you. Why SVG is the right file for this is covered in PNG vs SVG. Either way:

  1. Change only the module colour first, keeping the white background and quiet zone.
  2. Check the greyscale version: the modules should still look nearly black.
  3. Print or display it at its final size, on its final material.
  4. Scan it with at least three phones, including an older one, in dim and bright light.
  5. If any of them hesitates, darken the colour or go back to black.

If a recoloured code stops scanning, the troubleshooting guide walks through the other usual suspects before you blame the colour.

Pick colours with the contrast checked for you:Make a custom QR code

Related questions

It can be coloured, but not any colour. The modules must be clearly darker than the background, so dark blues, greens, and reds on white work, while yellow, light grey, or pastels do not. Converting the design to greyscale is a quick way to check.

On some phones, not on all. Inverted codes swap the dark and light roles the standard expects, and some readers cannot decode them. Placing a normal code inside a white box on the dark design is the reliable alternative.

Black on white. Any dark colour on a plain, pale background is the next best, but every step away from maximum contrast reduces the margin for bad light and poor printing.

It can, but it is risky. The light modules take on whatever colour is behind them, so on a dark or busy background the code can invert or disappear. Keep an opaque white or pale background behind the code and its quiet zone.

Yes. The custom QR code generator lets you choose the foreground and background colours, as long as the foreground is darker and the contrast ratio is at least 4.5:1; inverted codes are refused. Test the printed result on several phones before using it.