On this page

To check a QR code’s contrast, identify the color of its dark modules and the color directly behind them, then enter those two colors into a contrast checker. Use the resulting ratio as a guide when deciding whether to make the dark color darker or the background lighter.
A contrast result is only one part of the check. Look at the clear area around the code and test the finished version with different devices in the conditions in which people will encounter it. Also provide a descriptive label and a link or URL to the same destination for anyone who cannot scan.
Identify the two colors to compare
Start with the version that people will actually see. That could be an image in a document, a printed sample, or a code displayed on a screen. Identify the dark modules—the small dark shapes that make up the code—and the light background visible between and around them. Those are the two colors to compare.
If you have the original design, check whether its color settings identify the module and background colors. If the code is embedded in an image and you do not know the colors, use a color picker that lets you inspect that image. Select a representative point inside a dark module and record the value it gives you. Then select a point on the light background and record that value too. Check a few points if the colors appear to vary, especially near edges or in a textured background.
Avoid picking from the edge of a shape if you can select a clear area inside it. If the image appears to contain more than one dark or light color, make a note of the variation and check the relevant pairs rather than assuming one sample describes the whole image. Use the same format for your notes that the checker accepts, if you know it.
Look beyond the modules
Inspect the light, clear area immediately surrounding the code, often called the quiet zone, as well as the surface just beyond it. Ask whether text, a border, a pattern, or another design element comes close to the code. If the surrounding area is not clearly distinct, simplify it and test the revised version. The color pair is useful information, but it does not describe the entire layout.
Check and interpret the contrast
Open a contrast checker and enter the dark module color and the light background color in the fields it provides. Use the values you recorded from the design or image. If the checker offers a color picker, you can use it to select the colors where that suits your workflow; check the displayed values before relying on the result.
Read the contrast ratio returned for that pair. If the tool also displays accessibility guidance, use that information as a reference for evaluating the colors. The guidance can help you decide whether the pair needs more separation, but a favorable result is not a promise that every device will scan the code. Likewise, changing colors to improve a ratio is a reason to test again, not a substitute for testing.
A ratio describes the two colors entered into the checker. It does not tell you whether you selected the actual colors in the finished image or whether the area around the code is clear. It also cannot settle questions about the final size, print quality, lighting, screen glare, viewing distance, or the device someone uses. Those practical conditions need their own review.
For a useful comparison, keep a short record of the two color values and their result. If you make a change, enter the revised colors and compare the new result with the first one. Check the code itself as well: the aim is a version that is distinguishable in its setting and works when people try to scan it. For further accessibility guidance, see Section508.gov’s advice on accessible QR code implementation.
Adjust the code and its surroundings
If the colors are too similar for your purpose, try darkening the modules, lightening the background, or both. Make one deliberate change, record the new color values, and run the pair through the checker again. This makes it easier to see which adjustment produced the result you want.
For example, if a code uses dark gray modules on a tinted background, you might first try a darker gray while keeping the background unchanged. If the result is still unsatisfactory, try a lighter background and compare again. These are design choices to evaluate, not fixed color requirements. Keep checking the version that will actually be used, particularly if the code is placed over an image or colored design.
Give the code room
Review the area around the entire code, not just the space between its modules. Keep the surrounding area clear and visually distinct from nearby text, decorations, borders, or imagery. Then look immediately beyond that clear area: a busy surface next to it may make the overall presentation harder to assess. If necessary, adjust the layout so the code and its surrounding area are easier to distinguish.
After changing the layout, check that you have not accidentally covered or altered any part of the code. Recheck the color pair if either color has changed, and make a fresh sample for scanning. If the code is inside an image you cannot edit directly, consider obtaining an editable version or creating a replacement for the intended destination. Verify the destination and test the replacement before using it.
Test the finished code
Test the code in the form and setting people are expected to use. A successful check on a design preview is a useful start, but the practical question is whether someone can scan the finished version and reach the intended content. Use more than one device where possible, and include the kinds of devices or scanning apps your audience is likely to use.
For a printed code
Print a sample at the intended size and inspect it before scanning. Small size, poor print resolution, and low visibility or lighting can make a printed code difficult to scan. Try scanning from the distance and position a reader would reasonably use, under lighting similar to the planned setting. If the finished item may be encountered in different lighting, try representative conditions rather than relying on a single well-lit test.
If a scan fails, change one condition at a time. For example, try a closer position, better lighting, or a larger sample, then test again. If the printed code looks unclear, review the image and print quality as well. Keep track of which version and condition you tested so you can repeat the check on the final sample.
For a code on a screen
Display the code as it will appear to readers and try scanning it from another device. Consider the size on the screen, the likely viewing distance, and any glare in the intended setting. Poor contrast and device or app compatibility can also hinder scanning a digitally displayed code. Test with different devices or apps where practical, and check that the display has not made the code too small for the intended use.
If a high-contrast code still fails, revisit the surrounding clear area, the code’s size, the image quality, and the conditions of the test. Try another device or scanning app, and confirm that the code opens the intended destination when it does scan. After any change to the code or its presentation, repeat the relevant checks on the finished version.
Give readers another way to access the content
Place a descriptive label near the code so readers know what they will reach before they decide to scan. A label such as “Open the visitor information page” is more useful than a label that simply says “Scan this code,” because it describes the destination. Choose wording that matches the actual content.
Provide an accessible link or a readable URL to the same destination. On a digital page, a descriptive link gives readers another way to open the content without using the code. On a printed item, a readable URL gives someone an address they can enter. Check that the alternative and the code lead to the same intended destination and that the label still describes it accurately.
Consider the whole reader journey when placing the alternative. Can a person find the label and link without needing to scan first? Is the URL legible in the final printed sample? If the destination changes, update both the code and the alternative, then check them again.
A scan test and an alternative access route answer different practical questions. The test helps you assess whether the code works in expected conditions; the link or URL gives people another way to reach the content when scanning is inconvenient or unavailable.