Colour contrast calculator

WCAG relative-luminance contrast for opaque sRGB colours.

Your inputs

Input format

Use this format with your own values:

#000000
Input format

Use this format with your own values:

#ffffff

Use the units shown.

Contrast ratio
21
Normal-text AA
Pass

Your calculation
How is this calculated?

WCAG relative-luminance contrast for opaque sRGB colours. This checks contrast only, not full accessibility conformance.

Try an example

Worked example

Contrast ratio: 21

Inputs
  • Foreground HEX: #000000
  • Background HEX: #ffffff

Compare inputs

Contrast ratio: 21

Inputs
  • Foreground HEX: #ffffff
  • Background HEX: #000000
Share this page
Share this calculator

Leave unchecked to share the page without your entered values.