Contrast Checker

Compare opaque text and background colors with pickers, swap controls and WCAG contrast results.

On-device No sign-up Free to use

Check contrast controls

?

Enter an opaque HEX, rgb(), or hsl() value.

?

The color directly behind the text. Images and gradients need separate checks.

Processed in your browser. Your inputs stay on this device.

Showing an example. Edit to see your own.

Result

Showing an example.

Check dark gray text on white against the AA normal-text target.

#1F2937 on #FFFFFF has a contrast ratio of 14.68:1. It meets the selected 4.5:1 target.

Loading the tool. Your result will appear here.

https://usefreetools.net/contrast-checker · 20 November 2026

Was this helpful?

How to use Contrast Checker

  1. Enter the text color and the solid color directly behind the text.
  2. Choose a target for the suggested text color: AA normal, AA large or AAA normal.
  3. 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.

You add
Text color: #1F2937; Background color: #FFFFFF; Suggested color target: aa
You get
#1F2937 on #FFFFFF has a contrast ratio of 14.68:1. It meets the selected 4.5:1 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.

Page updated · Project managed by Tony Hines · Report a problem with Contrast Checker

Related reading

All guides