Skip to main content

Contrast checker

Check color combinations against WCAG contrast requirements and keep your website readable for everyone.
Pick colors
Choose a foreground and a background color for the contrast check.
RGB: 26, 26, 26|HSL: 0°, 0%, 10%
RGB: 255, 255, 255|HSL: 0°, 0%, 100%
Contrast result
17.40:1
Contrast ratio
Normal text
< 18pt or < 14pt bold
AAA
Large text
≥ 18pt or ≥ 14pt bold
AAA
UI components
Buttons, icons, focus indicators
AA

AA = minimum requirement. AAA = enhanced requirement. For UI components, WCAG 2.1 only has the 3:1 AA requirement.

Live preview
How the color combination looks at different text sizes

Sample heading (24px)

Large text (24px): Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore.

Normal text (16px): Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Small text (14px): Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

WCAG 2.1 contrast requirements
Minimum contrast ratios for different elements
WCAG 2.1 contrast requirements
ElementAA (minimum)AAA (enhanced)
Normal text (< 18pt)4.5:17:1
Large text (≥ 18pt or ≥ 14pt bold)3:14.5:1
UI components and graphics3:1n/a
Focus indicators3:1n/a

Check color contrast in three steps

  1. Enter the text color and the background color as HEX values (#RGB or #RRGGBB, the # is optional) or pick them with the color field.
  2. "Swap colors" exchanges the two fields.
  3. Read the ratio, e.g. 4.52:1. Below it, the tool rates three cases separately: normal text, large text, and UI components, each as AAA, AA, or "Failed".

The calculation follows WCAG 2.1 and runs in your browser while you type. The tool doesn't change anything on your website. It only tells you whether a color combination reaches the thresholds.

How to read the result

The levels build on each other. If the ratio is 5:1, for example, normal text passes AA but not AAA. Large text then even reaches AAA, because 4.5:1 is enough for it.

For UI components the tool only shows AA at 3:1, because WCAG 2.1 has no AAA level for them. This covers buttons, icons, and focus outlines, for example.

Whether your text counts as large is up to you, based on its font size. The tool can't detect that. Besides headings, check links, placeholder text, and buttons too.

What the live preview shows

The preview applies your colors to a 24-pixel heading, three paragraphs at 24, 16, and 14 pixels, and two buttons. This shows you whether a value that passes on paper is still comfortable to read in small type.

The "Dark preview" tab swaps the colors. The contrast ratio stays the same, because the formula only compares the lighter color with the darker one. Which color is text and which is background never changes the number.

Limits of the contrast checker

  • It always compares exactly two solid colors. It can't rate gradients, images, or semi-transparent areas.
  • The fields don't accept HEX values with an alpha channel.
  • It only checks the ratio, not typeface, stroke weight, or color vision deficiencies. A passing result doesn't replace a look at the finished page.

Frequently asked questions

Everything about color contrast and the WCAG guidelines
What is color contrast, and why does it matter?
Color contrast is the difference in brightness between a foreground color and a background color. Enough contrast keeps text readable and your website accessible. People with low vision or color vision deficiencies benefit from it, and so does anyone reading in poor light.
What do the WCAG levels AA and AAA mean?
The Web Content Accessibility Guidelines (WCAG) define three conformance levels: A, AA, and AAA. For normal text, AA requires a contrast ratio of at least 4.5:1 and AAA requires 7:1. For large text (18pt or 14pt bold and up), the requirements are lower: AA needs 3:1 and AAA needs 4.5:1.
How is the contrast ratio calculated?
The tool uses the WCAG formula: (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 that of the darker one. The result runs from 1:1 (no contrast) to 21:1 (black on white).
When does text count as large text?
Under WCAG, text is large if it is at least 18pt (about 24px) or at least 14pt (about 18.7px) and bold. Large text has lower contrast requirements because its size makes it easier to read. The tool can't see your font size, so you decide which row applies.
What are UI components in the context of accessibility?
UI components are interactive elements such as buttons, form fields, icons, and focus indicators. Under WCAG 2.1 they need a contrast ratio of at least 3:1 against adjacent colors so people can see and use them.
What can't the contrast checker test?
The tool compares exactly two solid colors. It can't rate gradients, background images, or semi-transparent areas, and the field doesn't accept HEX values with an alpha channel. Check such spots by hand, against the worst part of the background.
Is the contrast checker free, and are my colors sent anywhere?
Yes, it is free and needs no sign-up. The ratio is calculated in your browser while you type, and the tool does not send your colors to a server. You can check any number of color combinations.

Related tools

All tools

Changelog

Latest updates and improvements to the Contrast checker
v1.2.0

November 20, 2026

English version, preview by WCAG sizes

  • • Added this English version of the tool
  • • Fixed: the live preview called 18 pixels "Large text". Under WCAG, text counts as large only from 24 pixels (18pt), or from about 18.7 pixels (14pt) in bold. The large sample text is now 24 pixels
  • • The FAQ now names the limits of the tool: no gradients, images, or transparency
v1.1.0

November 17, 2026

Guide and related tools

  • • Added a guide with instructions and use cases below the tool
  • • Added related tools at the end of the page
  • • Clarified the changelog: colors are entered as HEX and shown as HEX, RGB, and HSL
v1.0.0

December 8, 2025

Launch

  • • Live contrast calculation under WCAG 2.1
  • • Check for normal and large text
  • • AA and AAA conformance display
  • • Color values shown as HEX, RGB, and HSL (input as HEX only)
  • • Live preview with sample text
  • • Color picker for easy color selection