TintShelf
Interface

Color contrast checker

Enter a text color and a background to see the WCAG 2.x contrast ratio and what it passes.

Large text sample

Normal body text reads like this.

  • AA normal text
  • AA large text
  • AA interface parts
  • AAA normal text
  • AAA large text

How is the contrast ratio calculated?

The ratio follows the WCAG 2.x formula: the relative luminance of the lighter color plus 0.05, divided by that of the darker color plus 0.05.

What contrast ratio does WCAG AA require?

Normal text needs 4.5:1 for AA and 7:1 for AAA; large text and interface parts need 3:1.

The closest passing color keeps your hue and chroma and moves only lightness in OKLCH until the text reaches 4.5:1, so the fix stays recognisably the same color. This site does not use APCA, whose license does not allow it here.

Ready answers

TextBackgroundRatioAA textAA large / UIAAA text
#767676#FFFFFF4.54:1PassPassFail
#777777#FFFFFF4.48:1FailPassFail
#595959#FFFFFF7.00:1PassPassPass
#FFFFFF#3366CC5.37:1PassPassFail
#000000#FFD70014.97:1PassPassPass
#FFFFFF#FF57333.15:1FailPassFail
#FFFFFF#2E8B574.25:1FailPassFail
#1B1C1E#F7F7F515.90:1PassPassPass
#FFFFFF#FF69B42.65:1FailFailFail
#000000#8080805.32:1PassPassFail
#FFFFFF#00008016.01:1PassPassPass
#FFFFFF#0080804.77:1PassPassFail

Related tools

Screens show the same code differently, and print adds more variation. CMYK here is the plain formula without a printer profile, so use it as a starting point, not a press value. Contrast numbers follow WCAG 2.x.