How to use Contrast Checker
- Enter the text color and the solid color directly behind the text.
- Choose a target for the suggested text color: AA normal, AA large or AAA normal.
- The contrast ratio and selected-target result update as you change either color. Check both the ratio and the text-size requirement.
Example: Contrast Checker
Check dark gray text on white against the AA normal-text target.
Options
- Text and background
- Enter opaque HEX, RGB or HSL colors, use the paired color pickers, or swap the colors. The numeric ratio compares those two colors. A photo, pattern, gradient or transparent layer can change the background behind individual letters.
- Suggested color target
- The suggestion moves only the text color toward black or white, then chooses the smaller passing adjustment along those two paths. It does not search every possible hue or assess the rest of your page.
Supported inputs and limits
- The ratio uses the WCAG 2.2 sRGB relative-luminance formula for two opaque, solid colors.
- AA normal text needs 4.5:1 and AA large text needs 3:1;
- AAA normal text needs 7:1 and AAA large text needs 4.5:1.
- The displayed ratio is rounded to two decimals, while pass or fail uses the unrounded value.
- The suggestion adjusts only the text color toward black or white.
More details
Some backgrounds cannot reach a selected target by changing text color alone.
This page does not check font size, weight, images, gradients or every other accessibility requirement.
Bare HEX is accepted.
The interface-component check uses the same unrounded 3:1 threshold; it does not inspect an actual component.
APCA and background-color suggestions are not provided.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
How this page calculates contrast
Each RGB channel is converted to linear light, then combined into relative luminance. The ratio compares the lighter and darker luminance values. This is the text-contrast method in WCAG 2.2, not a measure of color difference or readability in every situation. The AA and AAA labels here apply only to the listed text contrast criteria; they do not say that the whole page conforms to WCAG.
Questions about Contrast Checker
Why can 4.48:1 pass large text but fail normal text?
WCAG AA needs 4.5:1 for normal text and 3:1 for large text. Large text means at least 18 point, or 14 point when bold, with equivalent sizes for relevant fonts. Check the real size and weight before using the lower threshold; this tool does not inspect them.
Is the suggested color the nearest possible passing color?
It is the smaller adjustment found along two straight paths, one toward black and one toward white. Another hue may also pass and be a better design fit. Recheck the final colors after placing them in your page.
Can I use this result over an image?
The calculation assumes one solid background color. An image or gradient can be lighter or darker under different letters, so check the actual text area separately or give the text a solid background before relying on the ratio.