Compress

Compress JPGCompress PNGCompress WebPCompress AVIFCompress to 100 KBCompress to 200 KBCompress to 500 KB

Convert

Convert to JPGConvert to PNGConvert to WebPConvert to AVIFWebP to JPGPNG to JPGJPG to PNGWebP to PNG

Image tools

Crop ImageResize ImageImage to PDFImage to Base64

More tools

AI Prompt GeneratorColor PickerTime Zone ConverterQR Code GeneratorWord CounterPassword Generator
Accessibility

Color Contrast for Accessibility: WCAG Ratios Explained with Examples

Low contrast is one of the most common accessibility failures on the web, and one of the easiest to fix once you know the numbers.

The numbers to remember

ElementAA (usual target)AAA
Normal text4.5 : 17 : 1
Large text (≥ 24 px, or ≥ 18.66 px bold)3 : 14.5 : 1
UI components and meaningful graphics3 : 1n/a

These come from the Web Content Accessibility Guidelines (WCAG) 2.2 success criteria 1.4.3 (Contrast Minimum), 1.4.6 (Enhanced) and 1.4.11 (Non-text Contrast). Contrast ratios range from 1:1 (identical colours) to 21:1 (black on white).

How the ratio is calculated

Each colour is converted to a relative luminance L between 0 (black) and 1 (white), taking into account how the eye perceives red, green and blue differently. The ratio is (Llighter + 0.05) ÷ (Ldarker + 0.05). You do not need to do this by hand: the colour tool’s contrast checker shows the ratio and pass or fail for each level.

A useful fact: mid-grey #767676 on white is the lightest grey that just passes the 4.5:1 requirement for normal text. Anything lighter, which is very common for placeholder or caption text, fails.

Fixing failing colours

  1. Keep the hue, and change lightness. Convert to HSL and lower the lightness for text on a light background (or raise it for dark mode).
  2. Darken the text rather than lightening the background if the brand colour is the background.
  3. For buttons, ensure the label meets 4.5:1 against the button colour, and the button meets 3:1 against the page.
  4. Re-test after each change.

The colour tool’s HSL values and shade generator make it easy to step through lighter and darker versions of the same colour.

More than contrast ratios

  • Do not rely on colour alone to convey meaning (for example red for errors). Add an icon or text.
  • Check states: hover, focus, disabled and visited links need adequate contrast too, and focus indicators should be clearly visible.
  • Text over images: use an overlay or a solid panel so contrast holds on every part of the picture.
  • Dark mode: re-test, because colours that pass on white may fail on dark backgrounds.
  • Colour blindness: avoid red/green as the only distinction.

Worked examples

Text colourBackgroundRatio (approx.)Normal text AA?
#000000#FFFFFF21 : 1Pass
#767676#FFFFFF4.5 : 1Pass (just)
#999999#FFFFFF2.8 : 1Fail
#FFFFFF#3498DBabout 3.2 : 1Fail for normal text; passes for large text

The last row matters for this very site’s blue: white text on a mid-blue button passes the 3:1 threshold for large or bold UI text but not the 4.5:1 requirement for small body text, so use a darker blue for small text.

How to test a page quickly

  1. List your text and background colour pairs (body, headings, links, buttons, placeholders, captions).
  2. Enter each pair into the contrast checker.
  3. Fix failures by darkening text or lightening backgrounds, keeping hue.
  4. Check hover, focus and disabled states and dark mode separately.
  5. Test with a browser’s built-in accessibility inspector and, where possible, with real users.

Why it matters beyond compliance

Good contrast helps people with low vision, anyone reading in bright sunlight, and older readers, and it makes pages easier to read for everyone. Accessibility is also a legal or procurement requirement in some contexts.

Try it now: Color Picker

Free, private and runs in your browser. Nothing is uploaded.

Open Color Picker

Frequently asked questions

At least 4.5:1 for normal text and 3:1 for large text and UI components, to meet WCAG level AA. Aim higher where you can.
Text of at least 18 point (about 24 px) or 14 point bold (about 18.66 px).
Logos and decorative text are exempt from the text contrast requirements, but legibility still matters.
AA is the commonly required level. AAA is stricter and not always achievable for all content.

Sources and further reading

External links open the original source. We cite primary or official documentation for factual claims and re-check them when we update an article. See our editorial policy.

Keep reading