Black text on white gives 21:1
Input and settings
Foreground: #000000 / Background: #ffffff
Expected result
21.00:1 / All four displayed text checks pass
Check a foreground and background pair against WCAG 2.x AA and AAA contrast thresholds.
These are example steps; replace the values for your task.
The background cannot be transparent. A translucent foreground is composited over the background before calculation.
The ratio uses the WCAG 2.x relative-luminance formula. Black on white produces the maximum 21:1 ratio, followed by AA and AAA text checks.
Pass results cover text contrast only. Font weight, actual text size, controls, and other accessibility requirements still need separate review.
Compare black/white with gray text on white, separating the ratio from normal- and large-text checks.
Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.
Foreground: #000000 / Background: #ffffff
21.00:1 / All four displayed text checks pass
Foreground: #777777 / Background: #ffffff
4.48:1 / Only AA large text passes AA normal, AAA normal and AAA large text fail
Text thresholds are 4.5 for AA normal, 3 for AA large, 7 for AAA normal and 4.5 for AAA large text. Determine whether the actual font qualifies as large separately. The displayed ratio has two decimals, while pass/fail uses the unrounded value: a display of 4.50 can still fail if the actual ratio is below 4.5.
This compares a solid foreground with an opaque background. Translucent foregrounds are composited over that background; translucent backgrounds are rejected. Images, gradients, actual font size/weight and whole-page WCAG conformance are not assessed. Check the specified colors and criteria as well as the preview.
Verification: W3C text-contrast guidance supplies thresholds and unrounded comparisons. Independent relative-luminance calculations give 21 and about 4.478. Checks cover a 4.499 boundary, translucent-background rejection, localized pass lists and restoration.
Translucent text is composited onto the background before relative luminance is calculated. The raw text RGB value alone is not used.
AAA requires a higher contrast ratio than AA.
WCAG defines it by font size and weight; this tool reports the threshold but cannot infer your final CSS.
Yes. Foreground alpha is composited over the background before calculation.
Share only the tool name and public URL. Your input and results are not included.
Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.
Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.