فارسی

WCAG Color Contrast Checker

Check the contrast ratio of text and background, test WCAG AA and AAA, and find the nearest passing color.

Use this tool in your browser without installing software.

About this tool

Enter the text and background colors in HEX, RGB, or HSL and get the contrast ratio from the WCAG 2.1 formula. Results are shown separately for normal text, large text, and interface components. When the current pair is not enough, the tool suggests the nearest lightness with the same hue, and you can apply it in one click. Transparent colors are evaluated over white here; over an image, gradient, or another underlying color, the real result can differ.

How to use it

  1. 1

    Enter the text and background colors, or pick a common pair.

  2. 2

    Read the contrast ratio and the AA/AAA results for normal text, large text, and interface components.

  3. 3

    Apply the suggested color if needed, then copy the report.

Frequently asked questions

How is the contrast ratio calculated?

It uses the relative luminance of the two colors with the WCAG 2.1 formula. A ratio of 1 means no difference; 21 is the maximum, as with black on white.

What is the difference between AA and AAA?

AA is the common minimum: 4.5:1 for normal text and 3:1 for large text. AAA is stricter: 7:1 for normal text and 4.5:1 for large text.

What counts as large text?

Text at 24 px or larger, or bold text at 18.5 px or larger, counts as large text in WCAG and needs 3:1 for AA.

Why is no suggested color available?

If the background is close to mid grey, no text color can reach 7:1. Make the background lighter or darker instead.

How is a translucent color handled?

Transparent colors are composited over white for this calculation. Over an image, gradient, or another underlying color, the real result can differ.

Is any data sent anywhere?

No. Every calculation runs in your browser and neither the colors nor the report are uploaded.