Tool workspace
Color Contrast Checker
Input
Check color contrast ratios and WCAG 2.2 AA and AAA requirements for text, UI components, and graphics.
Input
Output
Loading tool
Color Tools
Color Contrast Checker
Need to check whether two colors have enough contrast? This color contrast checker compares a foreground color with a background color and shows the contrast ratio immediately.
Enter HEX color values or use the color pickers. Check the combination against WCAG 2.2 requirements for normal text, large text, and applicable non-text elements such as interface components and graphics. Preview sample text and a button, or swap and reset the colors.
Quick guide
How to use
- Enter a HEX value for the foreground color or choose one with its color picker.
- Enter a HEX value for the background color or use its color picker.
- Review the live contrast ratio.
- Check the WCAG 2.2 results for normal text, large text, and applicable non-text elements.
- Preview sample text and a button with your selected colors.
- Use Swap to exchange the foreground and background colors, or Reset to restore the defaults.
Details
About this tool
Color Contrast Checker
Color contrast describes the difference in relative brightness between two colors. Sufficient contrast can make text easier to distinguish from its background. A color contrast checker lets you test a foreground and background combination before using it in a website, application, design system, or other interface.
Enter HEX values or select colors with the pickers. The contrast ratio and WCAG 2.2 results update as the colors change.
How to check color contrast
Choose a foreground color for text or another element and a background color behind it. Enter HEX values directly or use the color pickers. The checker calculates the contrast ratio and displays results for the applicable WCAG thresholds.
What is a contrast ratio?
The contrast ratio describes the relative difference between two colors and is written as a ratio, such as 4.5:1. It ranges from 1:1, with no contrast difference, to 21:1, the maximum contrast between black and white. A higher ratio generally means a greater difference, but the required threshold depends on the use: normal text, large text, or applicable non-text content.
WCAG 2.2 contrast requirements
For normal text, WCAG AA requires at least 4.5:1 and AAA requires at least 7:1. For large text, AA requires 3:1 and AAA requires 4.5:1. Applicable user interface components and meaningful graphical objects have a 3:1 minimum under the relevant non-text criterion. The checker shows these results separately.
What counts as large text?
For WCAG contrast purposes, large-scale text is at least 18 point or 14 point bold. Point sizes and CSS pixel sizes are not always interchangeable in every context, so consider the text as it is actually rendered. If it does not meet the large-text definition, use the normal-text thresholds.
Understanding AA and AAA
AA and AAA are different WCAG conformance levels, and AAA requires stronger text contrast. A combination with a ratio of 5:1 passes normal-text AA but not normal-text AAA; it passes both large-text AA and AAA. Each Pass or Fail label refers to its displayed threshold.
Preview, swap, and reset
The preview shows sample text and a button with your selected colors. Use it alongside the numerical ratio to review the combination visually. Swap exchanges foreground and background colors, and Reset restores the default colors. Results update as you edit either color.
What a passing result means
A passing result means that the selected pair meets that particular contrast threshold. It does not mean that an entire website or interface is accessible. Accessibility also depends on typography, text size and spacing, focus indicators, keyboard navigation, labels, alternative text, content structure, motion, and screen-reader support. Color alone should not communicate important information.
When to use a color contrast checker
Check text and background colors while designing a website, compare text colors for readability, review button colors and identifying boundaries, test applicable controls and graphics, or inspect a color pair from an existing interface. Testing contrast early can help identify color combinations that need adjustment.
Check WCAG 2.2 contrast
Compare foreground and background colors and review the ratio against WCAG 2.2 AA and AAA thresholds for normal and large text, plus the applicable 3:1 non-text requirement.
Use HEX values or color pickers
Enter foreground and background colors as HEX values or choose them with the color pickers. The contrast result updates as you edit either color.
Preview the color combination
Preview sample text and a button with your selected colors to see how the combination looks alongside its numerical contrast ratio.
Swap or reset colors
Use Swap to exchange foreground and background colors, or Reset to restore the default colors.
Practical inputs
Color Contrast Examples
High contrast
Foreground: #000000 | Background: #FFFFFF
Contrast ratio: 21:1
Normal text
Check a color pair against the normal-text WCAG requirements.
AA: at least 4.5:1. AAA: at least 7:1.
Large text
Check a color pair used for large text.
AA: at least 3:1. AAA: at least 4.5:1.
Non-text elements
Check colors used for an applicable UI component or meaningful graphic.
Applicable WCAG 2.2 minimum: 3:1.
Help
Frequently asked questions
What is a color contrast checker?
It compares a foreground color with a background color, calculates their contrast ratio, and checks the combination against WCAG 2.2 contrast requirements.
How do I check the contrast between two colors?
Enter the foreground and background HEX values or select colors with the pickers. The contrast ratio and WCAG results update automatically.
What is a good color contrast ratio?
For WCAG 2.2, normal text generally needs 4.5:1 for AA and 7:1 for AAA. Large text needs 3:1 for AA and 4.5:1 for AAA. Applicable non-text elements need at least 3:1.
What contrast ratio does WCAG require for normal text?
WCAG 2.2 requires at least 4.5:1 for normal text at AA and 7:1 at AAA.
What contrast ratio does WCAG require for large text?
Large text requires at least 3:1 for WCAG AA and 4.5:1 for AAA.
What is the WCAG contrast requirement for UI components?
Applicable user interface components and meaningful graphical objects generally need at least 3:1 contrast against adjacent colors under the relevant WCAG 2.2 criterion.
What is the difference between AA and AAA?
AA and AAA are different WCAG conformance levels. AAA requires stronger text contrast, so a color pair can pass AA while failing AAA.
Can I enter HEX colors?
Yes. Enter foreground and background colors as HEX values or choose them with the built-in color pickers.
Can I preview the colors?
Yes. The preview displays sample text and a button using your selected foreground and background colors.
Does a passing contrast result mean my website is accessible?
No. It only indicates that the selected color pair meets the tested contrast threshold. Accessibility also depends on navigation, typography, focus states, labels, alternative text, structure, and other factors.