How the ratio is computed
Contrast is the ratio of relative luminances: lighter plus 0.05 over darker plus 0.05, spanning one to twenty-one. Relative luminance is not an RGB average — each channel is normalised to zero-one, linearised, then weighted at 0.2126, 0.7152 and 0.0722. That step matters most; using raw RGB values misleads, especially for blue and green.
Steps
- Enter text colour and background colour as HEX or through the picker.
- Read the live ratio alongside AA and AAA verdicts.
- Copy the result into design review notes.
- Load the example or reset.
- When short, shift lightness rather than hue — lightness moves the ratio most.
Thresholds in context
Body text needs 4.5:1 for AA; large text needs 3:1. Large means eighteen pixels, or fourteen pixels when bold. AAA tightens to 7:1 for body and 4.5:1 for large. Non-text elements — icons, input borders, chart fills — need 3:1. These are floors, not targets; body text at 7:1 reads noticeably better. Translucent text must be composited before measuring, never judged from the declared value.
Common mistakes
Judging a mockup instead of the rendered page: gradients and photos vary contrast by position, so measure the worst point. State colours get skipped, and grey placeholders or disabled buttons often fall under 3:1. Opacity-based colouring changes with the ground, so composite first. Only the primary colour gets tested, while link, error and success colours fail. And thin weights need more contrast to read equally.
Fixing a failure
In order: darken the text, lighten the ground, increase size or weight, then change hue. Darkening is most direct — pushing grey from fifty to thirty percent roughly doubles the ratio. Lightening grounds suits dark text. Bolder or larger text can lift a 3:1 pair into large-text compliance. Hue changes risk brand consistency, so when a brand colour must stay, confine it to non-text elements and pick a darker text colour.