No, the order of the two colors does not change the result in any WCAG contrast checker. The WCAG contrast ratio formula, (L1 + 0.05) / (L2 + 0.05), is mathematically symmetric and returns the same number whether you enter foreground first or background first. Contrast is a property of the color pair itself, not a property of which one is acting as text. Once both hex codes are in their fields, the checker computes a single ratio, and that ratio is identical whether the lighter color is on top or underneath. L1 is defined as the relative luminance of the lighter of the two colors after sRGB linearization, so swapping the inputs cannot reorder the division. This means you don't have to retest mirror pairs when you flip dark-mode tokens, hover states, or inverted focus indicators — the math is direction-agnostic by construction. A standard checker such as the Color Contrast Checker takes both inputs, calculates the ratio once, and displays pass or fail badges for AA normal text, AA large text, AAA normal text, AAA large text, and the non-text contrast rule, all derived from the same symmetric operation. Implementations that follow the official specification produce values between a minimum of 1:1 for identical colors and a maximum of 21:1 for pure black on pure white, and every point in between is paired with its swap.

The Math Behind the Symmetric Ratio
WCAG 2.x defines contrast ratio as the difference in perceived brightness between two colors, expressed so that 1:1 means no difference at all and 21:1 is the largest gap a screen can show. The exact formula is (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker colors respectively. Luminance itself comes from a per-channel conversion: each sRGB component is linearized with the standard gamma curve, then combined with the perceptual weights 0.2126 for red, 0.7152 for green, and 0.0722 for blue. Green dominates because the eye is most sensitive to it, red contributes most of the rest, and blue matters least for legibility.
Because the formula takes the lighter color first and the darker one second, there is no field inside the calculation called "light" or "dark" — the implementation looks at both values, sorts them internally, and returns one number. The asymmetry people sometimes expect from the inputs ("foreground means L1") is not in the math; it only shows up in how the result is reported and presented. The W3C reference page for the contrast minimum, the source of truth for screen readers and checkers alike, states the formula in this direction-agnostic form directly on the WCAG 2.1 Understanding page.
To see this in numbers, take the textbook maximum pair: black #000000 against white #ffffff. After linearization, the relative luminance of white is 1.0 and the relative luminance of black is 0. Plugging into the formula gives (1.0 + 0.05) / (0 + 0.05) = 1.05 / 0.05 = 21, the ceiling. Enter white first and black second and the answer is still 21:1, because the formula picks L1 = 1.0 either way; the two inputs are unchanged, only their labels have flipped.
How to Check Contrast in the Color Contrast Checker
- Open the Color Contrast Checker in your browser. The page loads with foreground and background inputs and a live result panel already on screen.
- Set the foreground (text) color using the color picker or by typing a hex value such as #111111 into the text field for that input.
- Set the background color the same way, for example by typing #ffffff or by clicking the swatch and picking a value from the color picker.
- Read the contrast ratio that appears at the top of the result panel, along with the AA/AAA pass or fail badges for normal text, large text, and the non-text contrast threshold.
- Adjust either color — foreground or background, in either order — until each badge you care about shows a pass for the level you target, and copy the hex codes out for your design tokens.
Because the ratio is symmetric, you can swap the two inputs as many times as you like to compare a brand's light theme, dark theme, and hover states against the same standard without recomputing anything. Each variation of the design shows its own ratio, and you keep the one that lifts every pass badge to green.
WCAG Thresholds at a Glance
| Standard | Normal text | Large text | UI components and graphics |
|---|---|---|---|
| WCAG 2.x Level AA | 4.5:1 or higher | 3:1 or higher | 3:1 or higher |
| WCAG 2.x Level AAA | 7:1 or higher | 4.5:1 or higher | No defined threshold |
The thresholds in the table come straight from the WCAG 2.x specification. Large text means at least 18pt regular weight (24px) or 14pt bold (about 18.66px), and the lower ratio is allowed because thicker strokes are easier to read. The UI components rule covers form field borders, focus indicators, icons, and other graphical objects that need to be perceivable without relying on adjacent labels. If you want to see actual passing pairs you can lift directly into a design system, the article Color Contrast Checker Examples: WCAG AA and AAA Pairs lays several out with their exact ratios and use cases.
What the Contrast Ratio Doesn't Measure
A symmetric ratio is reassuring, but it only describes one thing: the difference in luminance between two colors, weighted the way human vision is most sensitive to green. Two colors can share a luminance yet look wildly different. A vivid red and a vivid green at similar brightness can fail because they essentially cancel out in the formula even though one of them is the color most visible to viewers with deuteranopia. This is also why WCAG 2.x cautions against relying on color alone to convey meaning; pair color with text labels, icons, or underlines so that everyone reaches the same conclusion regardless of which colors they can distinguish.
The ratio also doesn't trace its way across a gradient or a semi-transparent overlay. If your text sits on a hero image that fades from one corner to another, the effective background under each letter can range over hundreds of luminance values. Test the pair at its lightest point and its darkest point, because the worst case is what your visitors will hit at some point in the layout. The same goes for placeholder text, which designers often leave in a low-contrast pale gray, and for disabled form controls, which by convention look washed out but still need to clear the 3:1 UI threshold against the surrounding canvas. None of these caveats are caused by color order — they are limits of the underlying luminance metric that the formula is built to report.
Practical Tips for Testing Color Pairs
Treat AA as a floor, not a finish line. If a body text pair clears 4.5:1 by a tenth of a point, a future change to either color can quietly drop it below the threshold, so engineers tend to budget for a contrast of 5.5:1 or more to keep room for minor tweaks. Where you can clear 7:1, treat it as AAA and aim for it, because the wider gap feels easier on the eye and stays compliant even if a color drifts during a brand refresh.
Test in bulk rather than color by color. Wire the checker into a design-tokens review by running every text-on-background combination in a spreadsheet through the formula, or save a small set of approved pairs in the design system. With symmetric ratios, you only need to test the unordered pair — (#111111, #ffffff) covers both light text on dark and dark text on light, halving your test matrix. Keep a second pass for states you don't usually think about: focus rings, error messages, placeholder text, disabled buttons, and any link rendered in a saturated brand color that didn't pass against the new background.
Everything runs locally in your browser, so private brand palettes and design tokens stay on the device while you iterate. That matters when accessibility reviews include colors that have not been announced externally. Combined with the formula's symmetry, it means the only real work left is the artistic one — choosing which two colors to ship.
Related reading: Avoid Mistakes When Using a WCAG Color Contrast Checker.