Private browser tool

Color Contrast Checker & Converter

Compare two HEX colors, check WCAG 2.2 text contrast and view the sample and RGB/HSL values after calculating.

Use the tool

Enter 3 or 6 hexadecimal digits, with or without # (for example, #123 or 123456).

Text sample after calculation

ABCDEFGHIJKLMNOPQRSTUVWXYZ · 0123456789

Result

—

Enter the values and run the tool.

Normal text AA—
Normal text AAA—
Large text AA—
Large text AAA—
Foreground HEX—
Background HEX—

Ratios are displayed approximately, to at most 6 decimal places; pass/fail uses the unrounded value. Large text means at least 18 pt (24 CSS px), bold 14 pt, or an equivalent size for Chinese, Japanese or Korean fonts.

Official WCAG 2.2 guidance: W3C: Text contrast AA (1.4.3) · W3C: Text contrast AAA (1.4.6)

What this tool does

Test a foreground and background pair against objective text-contrast thresholds while keeping common color formats together.

How to use it

  1. Enter foreground and background HEX colors or use the color pickers.
  2. Calculate the contrast ratio and the four AA/AAA text checks.
  3. Review the calculated sample and copy the ratio, checks and HEX, RGB and HSL values.

Formula and method

sRGB channels are linearized into relative luminance. Contrast ratio = (lighter luminance + 0.05) ÷ (darker luminance + 0.05); results are not rounded before threshold tests.

Example

Black on white gives 21:1 and passes all four text checks. #008580 on #FFFFFF gives about 4.499954:1 and fails normal-text AA because it is below 4.5:1.

Useful for

  • Checking website text colors
  • Converting HEX into RGB and HSL
  • Reviewing design tokens before release

Limits and notes

Checks two opaque solid colors only. It does not measure gradients, images, transparency, actual font rendering or focus indicators. These are text-contrast results, not an audit of non-text contrast or overall accessibility.

Frequently asked questions

Which thresholds apply?

WCAG 2.2 uses at least 4.5:1 for normal-text AA and 7:1 for AAA; large text needs 3:1 and 4.5:1 respectively. Font size is checked as delivered, before user zoom.

Does passing make the page accessible?

No. This checks only text-color contrast. Structure, keyboard operation, labels, non-text contrast and focus need separate checks.

Transparency

Sources & methodology

Calculation method
sRGB channels are linearized into relative luminance. Contrast ratio = (lighter luminance + 0.05) ÷ (darker luminance + 0.05); results are not rounded before threshold tests.
Evidence basis
Transparent arithmetic using values entered by the user.
Applies to
Ratios are displayed approximately, to at most 6 decimal places; pass/fail uses the unrounded value. Large text means at least 18 pt (24 CSS px), bold 14 pt, or an equivalent size for Chinese, Japanese or Korean fonts.
Last reviewed
Limitations
Checks two opaque solid colors only. It does not measure gradients, images, transparency, actual font rendering or focus indicators. These are text-contrast results, not an audit of non-text contrast or overall accessibility.

Content basis and verification

· Calculations run in your browser. Check the formula and assumptions on this page, and confirm important financial, tax, medical or legal decisions against current official guidance.
Maintained and reviewed by: Easynivo · Report a correction or source change