1. Home
  2. Color
  3. Contrast Checker

Contrast Checker

Check text and background contrast against WCAG AA and AAA.

For every format and option in one place, use Color Tools →

Runs in your browser · No upload
Any format works: HEX, RGB, HSL.
 
Any format works: HEX, RGB, HSL.
 
Contrast ratio
3.10:1
Passes AA for large text only
Preview
Pass or fail per criterion
CheckWCAG 2.2 criterionRequired ratioResult
AA body text1.4.3 Contrast (Minimum)4.5:1Fail
AA large text1.4.3 Contrast (Minimum)3:1Pass
AAA body text1.4.6 Contrast (Enhanced)7:1Fail
AAA large text1.4.6 Contrast (Enhanced)4.5:1Fail
UI components and graphics1.4.11 Non-text Contrast3:1Pass

Large text means 24px or more, or 18.66px (14pt) or more in bold. Ratios are shown rounded down to two decimals.

Nearest passing color

Keeps hue and chroma and moves only the lightness to the first value that passes.

Use #d64300 for 4.50:1

How to use

  1. Enter a HEX, RGB or HSL value for the text color and the background color, or use the color pickers. Swap text and background colors exchanges them.
  2. The large number on top is the contrast ratio, from 1:1 (identical colors) to 21:1 (black on white). The body text grade is shown right below it.
  3. The preview shows how large text, body text, a button outline and an icon actually look.
  4. The table lists pass or fail for each AA and AAA criterion.
  5. If a pair falls short, open Nearest passing color, choose the target and which color to change, and press Apply.

WCAG 2.2 criteria

Check Success criterion Required ratio
AA body text 1.4.3 Contrast (Minimum) 4.5:1
AA large text 1.4.3 Contrast (Minimum) 3:1
AAA body text 1.4.6 Contrast (Enhanced) 7:1
AAA large text 1.4.6 Contrast (Enhanced) 4.5:1
UI components and graphics 1.4.11 Non-text Contrast 3:1

Large text is 24px (18pt) or larger, or 18.66px (14pt) or larger in bold. Graphics that carry information, such as input borders, icons and chart lines, need at least 3:1 against their background. Inactive controls, pure decoration and logotypes are exempt. The ratios in WCAG 2.2 are the same as in 2.1.

How it is calculated

Each channel (R, G, B) is scaled to 0 to 1 and linearized: values up to 0.04045 are divided by 12.92, and others use ((c + 0.055) / 1.055)^2.4. Relative luminance is L = 0.2126R + 0.7152G + 0.0722B. The contrast ratio is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05.

Text Background Ratio Body AA
#000000 #ffffff 21:1 Pass
#3366cc #ffffff 5.36:1 Pass
#767676 #ffffff 4.54:1 Pass
#777777 #ffffff 4.47:1 Fail (large text passes)
#808080 #ffffff 3.94:1 Fail
#ff5b1f #ffffff 3.10:1 Fail
#ffff00 #ffffff 1.07:1 Fail

Ratios are shown rounded down to two decimals. An actual 4.478 displayed as 4.48 looks close to 4.5 but still fails, and the verdict always uses the unrounded value.

Finding the nearest passing color

The suggestion works in OKLCH: it keeps hue and chroma and moves only lightness up or down to the first point that reaches the target. Orange #ff5b1f text on white becomes #d64300 at 4.5:1, and #3366cc reaches 7:1 (AAA) as #2253b8. When lightness alone cannot get there, such as white text on a mid gray background, the tool says so.

Things to keep in mind

  • Passing a ratio does not guarantee readability. Very thin fonts, small sizes and pale text on dark backgrounds can be harder to read than the number suggests.
  • Transparency (alpha) is not calculated. Enter the final blended color to check it.
  • To see how a pair looks to people with color vision deficiency, run it through Color Blindness Simulator.
  • This tool is a reference, not a certification. For compliance decisions, use the official WCAG text and your audit tools.
  • For notation changes, use Color Code Converter. For lightness steps of one color, see Color Shades Generator.

Frequently asked questions

Where does the 4.5:1 ratio apply?

It is the AA minimum between normal-size body text and its background. Large text only needs 3:1.

Should I aim for AA or AAA?

Most accessibility requirements target AA. AAA is stricter and is not required for every color, but it makes long passages of body text easier to read.

Is white or black text more readable on my color?

It depends on the background luminance. Enter both and pick the higher ratio. On #ff5b1f, for example, black has more contrast than white.

Is the color I enter sent to a server?

No. All calculations run in your browser and nothing is sent to a server.

Can't find the tool you need?

Tell us what you want to do. We build the most requested tools first.