Skip to content

Color Contrast Ratio Calculator

Check text and background contrast against WCAG AA and AAA. Get ratios, live preview and accessible color suggestions. Free and no signup.

  • 100% free
  • No Signup
  • WCAG AA & AAA
Contrast ratio Excellent
0:1

WCAG 2.1 results
    Live preview

    Large text sample (24px)

    Normal text sample. The quick brown fox jumps over the lazy dog, so you can judge how readable this color combination is at body size.

    Button UI component
    Copied
    ADVERTISEMENT
    Demo Ad 728 x 90 320 x 100

    How to check color contrast

    1. 1

      Enter two colors

      Choose your text color and background color with the picker or HEX codes.

    2. 2

      Read the ratio

      See the exact contrast ratio and whether it passes WCAG AA and AAA.

    3. 3

      Fix failures

      Apply a suggested color that meets the level you need and copy the CSS.

    COLOR ACCESSIBILITY GUIDE

    Color Contrast Ratio Calculator – Free WCAG Contrast Checker for Text and Background Colors

    Looking for a free color contrast ratio calculator that tells you in one second whether your text is readable? Our WCAG contrast checker compares a foreground color with a background color, shows the exact contrast ratio from 1:1 to 21:1, and tells you whether the combination passes WCAG 2.1 Level AA and Level AAA for normal text, large text and user interface components. You also get a live preview of real text and buttons, plus accessible color suggestions that keep your original hue but adjust the lightness until the contrast requirement is met. There is no signup, no software to install and no watermark. Whether you are a web designer checking a brand palette, a developer fixing an accessibility audit, a UI and UX designer building a design system, a content creator making slides or social posts, or a student learning about web accessibility, this online color contrast checker gives you a fast and reliable answer. It works as a text and background color contrast checker, a button color contrast checker and a color accessibility checker in one simple tool.

    WCAG AA and AAA Contrast Checker

    See pass or fail results for AA normal text, AA large text, AAA normal text, AAA large text and non-text UI components. The checker uses the same relative luminance formula defined in WCAG 2.1, so the ratio matches what accessibility auditors expect.

    Live Text and Button Preview

    Numbers are useful, but you also need to see the result. The live preview shows large text, normal paragraph text, a button and a bordered UI component in your exact colors, so you can judge readability the way your visitors will.

    Accessible Color Suggestions

    When a combination fails, the tool suggests nearby text colors that reach 4.5:1 for AA and 7:1 for AAA. Click a suggestion to apply it instantly, then copy the CSS. It is the quickest way to make a color palette accessible without losing your brand look.

    How to Check Color Contrast Online (Step by Step)

    Checking contrast does not need browser extensions or design software. You only need the two colors you want to compare, and the calculator does the math for you. Follow these steps to test any text and background combination.

    1. Enter the text color: Click the foreground color box or paste a HEX code such as #1F2937. This is the color of your text, icon or border.
    2. Enter the background color: Set the color that sits behind the text, such as a page, card or button background.
    3. Read the contrast ratio: The large number shows the exact ratio, and the label tells you whether it is excellent, good, large-text only or a fail.
    4. Review the WCAG results: Check each row to see if the pair passes AA or AAA for normal text, large text and UI components.
    5. Apply a suggestion if needed: If the pair fails, click a suggested color, then use Copy CSS to take the result into your stylesheet.

    Everything updates as you type, so it is easy to test many combinations in a few minutes. The swap button is handy for checking light text on a dark background and dark text on a light background with one click.

    What Is a Color Contrast Ratio?

    A color contrast ratio is a number that describes how different two colors are in brightness. It is calculated from the relative luminance of each color, which measures how bright a color appears to the human eye on a scale from 0 for pure black to 1 for pure white. The ratio is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05. The result always falls between 1:1, which means two identical colors with no contrast, and 21:1, which is black on white and the maximum possible contrast.

    Relative luminance is not a simple average of red, green and blue. Human eyes are most sensitive to green, less to red and least to blue, so the WCAG formula weights the three channels at about 21 percent, 72 percent and 7 percent after converting from the sRGB color space. This is why two colors that look equally bright on paper can have very different contrast ratios in practice, and why a calculator is far more reliable than guessing by eye.

    • 1:1 means the colors are identical and the text is invisible.
    • 3:1 is the minimum for large text and for UI components such as input borders and icons.
    • 4.5:1 is the minimum for normal body text at Level AA.
    • 7:1 is the target for normal text at Level AAA.
    • 21:1 is the maximum, reached by pure black on pure white.

    WCAG Contrast Requirements: AA vs AAA Explained

    The Web Content Accessibility Guidelines, known as WCAG, are the international standard for accessible websites and apps. They define three conformance levels, A, AA and AAA, and Level AA is the one most organizations, laws and procurement rules aim for. Contrast is covered by three success criteria, and the table below summarizes what each one asks for so you know which result in the calculator matters for your project.

    WCAG 2.1 color contrast requirements
    Level Applies to Minimum ratio Success criterion
    AA Normal text 4.5:1 1.4.3 Contrast (Minimum)
    AA Large text 3:1 1.4.3 Contrast (Minimum)
    AA UI components and graphics 3:1 1.4.11 Non-text Contrast
    AAA Normal text 7:1 1.4.6 Contrast (Enhanced)
    AAA Large text 4.5:1 1.4.6 Contrast (Enhanced)

    For most websites, passing AA is the practical goal and is what many accessibility regulations and standards, such as Section 508 in the United States, EN 301 549 and the European Accessibility Act in Europe, point to through WCAG 2.x. Level AAA is stricter and is not required for entire sites, but it is an excellent target for body text, for products used by older audiences and for content where readability is critical.

    What Counts as Large Text in WCAG?

    Large text is easier to read at lower contrast, so WCAG allows a reduced ratio for it. Text counts as large when it is at least 18 point, which is about 24 CSS pixels, or at least 14 point when it is bold, which is about 18.66 CSS pixels. Anything smaller is treated as normal text and must meet the higher ratio. The table below shows common sizes so you can decide which row of the calculator applies to your design.

    Normal text vs large text in WCAG
    Text style Approximate size Counts as AA ratio needed
    Regular weight Under 24px (18pt) Normal text 4.5:1
    Regular weight 24px (18pt) or larger Large text 3:1
    Bold weight Under 18.66px (14pt) Normal text 4.5:1
    Bold weight 18.66px (14pt) or larger Large text 3:1

    Keep in mind that thin or light font weights can look weaker than their size suggests. Even when a pair technically passes, a very thin typeface at a small size may still be hard to read, so use the live preview as a second check.

    Examples: How Gray Text on White Measures Up

    Light gray text is the most common contrast failure on the web, because it looks clean and modern but is often too faint. The examples below show how small changes in a gray text color on a white background change the ratio and the WCAG result. They are a useful reference when you choose colors for captions, placeholders, helper text and secondary labels.

    Gray text colors on a white background
    Text color Approx. ratio AA normal AAA normal
    #000000 21:1 Pass Pass
    #595959 7:1 Pass Pass
    #767676 4.54:1 Pass Fail
    #777777 4.48:1 Fail Fail
    #949494 3.03:1 Fail (large text only) Fail

    Notice that #767676 is generally cited as the lightest gray that still meets AA for normal text on white, while #777777 just misses it. A difference that small is invisible to the eye, which is exactly why a precise contrast ratio calculator matters.

    Why Color Contrast Matters for Accessibility, SEO and Conversions

    Good contrast is one of the simplest and most effective accessibility improvements you can make. Millions of people have low vision, and many more have color vision deficiency, which affects roughly 8 percent of men and about 0.5 percent of women. Everyone also experiences temporary limits, such as glare from sunlight on a phone screen, a dim laptop display late at night or tired eyes after a long day. Text that is easy to read in ideal conditions can become unreadable in these situations if the contrast is weak.

    Readable colors also help your business. Visitors who can read your content, find your buttons and understand your forms are more likely to stay, sign up and buy. Accessibility is increasingly a legal and procurement requirement, and accessible design usually improves usability for everyone. Search engines reward pages that people use successfully, and accessible pages tend to have clearer structure and better user engagement, so contrast work supports your wider site quality as well.

    • Low vision and aging eyes: Higher contrast keeps text legible when vision is reduced.
    • Color blindness: Strong luminance contrast works even when hues are confused.
    • Mobile and outdoor use: Bright light washes out low-contrast colors first.
    • Legal and compliance: Meeting AA reduces accessibility risk and supports audits.
    • Better conversions: Clear buttons and readable forms keep users moving.

    Button, Link and Form Contrast: What to Test Beyond Body Text

    Contrast is not only about paragraphs. Every element that people must see or operate should be checked. Button labels count as text and need 4.5:1 against the button background, unless they are large. The button itself, if it has no visible text label or is identified only by its shape, also needs 3:1 against the surrounding page under the non-text contrast rule. Form fields are a frequent trouble spot: the border of an input should reach 3:1 against its background so users can tell where to type, and placeholder text must meet the same text ratio as other text.

    • Links inside paragraphs: If links are distinguished only by color, they need at least 3:1 against the surrounding text, plus 4.5:1 against the background. An underline is the easiest fix.
    • Focus indicators: The outline that shows keyboard focus should reach 3:1 against the colors next to it.
    • Icons and charts: Icons that carry meaning and important chart lines or bars should reach 3:1 against their background.
    • Error and success messages: Check message text, and do not rely on red or green alone to communicate status.
    • Disabled controls and logos: These are exempt from WCAG contrast requirements, but readable disabled states are still a good practice.

    How to Fix Low Contrast Without Changing Your Brand

    A failed result does not mean you have to abandon your brand color. In most cases you only need to adjust lightness, not hue. This calculator keeps the hue and saturation of your text color and moves the lightness away from the background until the target ratio is met, which usually produces a color that still feels like your brand. If a brand color cannot reach the ratio on a particular background, change the background instead, or use the brand color only for large elements, borders and accents while keeping body text neutral and dark.

    1. Darken light text on light backgrounds: Lower the lightness of the text color until it reaches 4.5:1 or 7:1.
    2. Lighten dark text on dark backgrounds: This is the usual approach for dark mode interfaces.
    3. Change the background shade: A slightly lighter or darker background can fix a pair without touching the text color.
    4. Switch to black or white text: On saturated button colors, white or near-black text is often the most reliable choice.
    5. Increase size or weight: If a pair only passes the large text threshold, make the text large enough to qualify, or choose a better pair for small text.

    Contrast Tips for Dark Mode, Images and Gradients

    Dark mode needs its own contrast check, because a palette that passes in light mode does not automatically pass in dark mode. Pure white text on a pure black background has very high contrast but can cause glare, so many designers use off-white text on a very dark gray. Test that combination here to confirm it still reaches the ratio you want. Colored text and accent colors usually need to be lighter in dark mode than in light mode to keep the same readability.

    Text placed over photos, videos or gradients is harder, because the background changes from one area to another. Test the worst case, which is the area where the text is closest in color to the background. A semi-transparent dark overlay behind the text, a solid text box or a text shadow can make the result consistent. Remember that this calculator compares two solid colors, so if your design uses transparency, check the final blended color rather than the original value.

    • Test every state: Check default, hover, active, focus and visited colors.
    • Use design tokens: Define accessible text and background pairs once and reuse them across the product.
    • Check both themes: Run light mode and dark mode palettes through the calculator separately.
    • Do not rely on color alone: Add icons, labels or underlines so meaning survives low contrast and color blindness.

    Who Uses a Color Contrast Checker?

    A color contrast ratio calculator is useful far beyond accessibility specialists. Anyone who chooses colors for text benefits from checking them, and the check takes only seconds.

    • Web designers and UI designers: Validate brand palettes, buttons, cards and form states before handing designs to developers.
    • Front-end developers: Fix accessibility audit issues from tools such as Lighthouse and axe by finding compliant colors fast.
    • Marketers and content creators: Make sure email banners, social graphics, slides and ads are readable on every screen.
    • Teachers and students: Learn how the WCAG formula works and why some color combinations fail.
    • Product and QA teams: Document pass and fail results for accessibility reviews and compliance reports.

    Limits of Any Contrast Ratio Calculator

    A contrast ratio is a strong and widely accepted measure, but it is not the only factor in readability. WCAG 2.x contrast does not take font weight, thin strokes, letter spacing, anti-aliasing or surrounding context into account. Some pairs, especially saturated colors such as red on blue or dark text on mid-tone backgrounds, can pass the numeric test and still feel uncomfortable to read. Newer approaches to perceptual contrast are being explored for future versions of the guidelines, but WCAG 2.x remains the standard used by laws, audits and testing tools today. Treat the ratio as a required minimum, review the live preview, and test with real users and real devices whenever you can.

    Free Color Contrast Checker for Any Device, No Software Needed

    Our color contrast ratio calculator runs in your web browser, so you can use it on Windows, Mac, Linux, Android and iPhone without installing anything. Whether you search for a WCAG contrast checker for web design, a text and background color contrast checker on mobile or a quick AA and AAA color accessibility checker for a client review, the steps are the same in any modern browser. Open the page, enter your two colors, read the result and copy your CSS. There is no account to create, nothing to download and no watermark, and the colors you enter are never uploaded.

    It also fits neatly into your design workflow. Pick colors in Figma, Canva, Photoshop or your code editor, paste the HEX codes here to verify them, and bring the corrected values back into your project.

    Color Contrast Ratio Chart for Common Pairs

    Use this chart as a quick reference for popular text and background pairs. The results refer to normal sized text.

    Color contrast ratio chart
    Text colorBackgroundRatioAA normal textAAA normal text
    #000000#FFFFFF21.00:1PassPass
    #111827#FFFFFF17.73:1PassPass
    #FFFFFF#1E3A8A10.35:1PassPass
    #111827#FACC1511.58:1PassPass
    #E5E7EB#12121215.13:1PassPass
    #FFFFFF#DC26264.82:1PassFail
    #767676#FFFFFF4.54:1PassFail
    #777777#FFFFFF4.47:1FailFail
    #9CA3AF#FFFFFF2.53:1FailFail
    #FFFFFF#22C55E2.27:1FailFail

    What Do 3:1, 4.5:1 and 7:1 Contrast Ratios Mean?

    Meaning of key WCAG contrast ratios
    RatioWhat it meets
    3:1AA for large text, and the non-text minimum for important UI parts and graphics
    4.5:1AA for normal text and AAA for large text
    7:1AAA for normal text

    A ratio is a threshold, so values are not rounded up to pass. A result of 4.49:1 does not meet a 4.5:1 requirement.

    Contrast Testing Workflow for Design Teams

    1. List every text color and the surfaces it appears on.
    2. Test body text, headings, links, buttons and helper text.
    3. Include hover, focus, error and selected states.
    4. Record approved pairs next to your color tokens.
    5. Retest when a brand color, theme or component changes.

    A short list of approved pairs saves time later, because designers and developers can reuse combinations that were already checked.

    Contrast Requirements for Placeholder Text and Charts

    Placeholder text that people need to read should be treated as text and given enough contrast. It should also not replace a visible field label. In charts, labels and legends follow text contrast rules, while lines, bars or segments needed to understand the data should be distinguishable from nearby colors. Direct labels and patterns help readers who cannot rely on color differences.

    Related Accessibility and Color Tools

    Check how a design may look with color vision deficiency in the Color Blindness Simulator, understand the math with the Color Luminance Calculator, or find a readable text color quickly with the Text Color Selector.

    Free Online Contrast Ratio Calculator: Fast, Accurate and Accessible

    Our free color contrast ratio calculator was built to make accessible color choices simple for everyone. If you want a WCAG contrast checker with exact ratios, AA and AAA results, a live preview and suggested fixes, this page gives you all of it in one place. Enter your colors, review the result and ship designs that more people can read.

    Ready to try it? Scroll back up, enter your text and background colors and check your contrast now. If you also work with palettes, explore the other free color tools on our site.

    ADVERTISEMENT
    Demo Ad 300 x 250 300 x 250
    COMMON QUESTIONS

    Color Contrast Ratio Calculator FAQ

    Quick answers about WCAG contrast ratios, AA and AAA levels and making your colors accessible.

    What is a good color contrast ratio?

    For normal text, a ratio of at least 4.5:1 is the WCAG Level AA minimum, and 7:1 or higher meets the stricter Level AAA. For large text and for UI components such as input borders and icons, 3:1 is the AA minimum. Higher is generally better for readability.

    What is the difference between WCAG AA and AAA?

    Level AA is the standard target for most websites and requires 4.5:1 for normal text and 3:1 for large text. Level AAA is stricter and requires 7:1 for normal text and 4.5:1 for large text. AAA is not required for whole sites, but it is a great goal for body text and critical content.

    What counts as large text in WCAG?

    Text is large when it is at least 18 point (about 24px) in regular weight, or at least 14 point (about 18.66px) in bold. Large text can use a lower contrast ratio because bigger letters are easier to read. Anything smaller is normal text.

    How is the contrast ratio calculated?

    Each color is converted to relative luminance using the sRGB formula in WCAG, which weights red, green and blue by how bright they appear to the human eye. The ratio is then the lighter luminance plus 0.05 divided by the darker luminance plus 0.05, giving a value from 1:1 to 21:1.

    Do buttons, icons, placeholders and disabled elements need contrast?

    Button labels and placeholder text are text, so they need the normal or large text ratio. Meaningful icons, input borders and focus indicators need 3:1 under the non-text contrast rule. Disabled controls and logos are exempt from WCAG contrast requirements, although readable disabled states are still good practice.

    How do the suggested colors work?

    The tool keeps the hue and saturation of your text color and adjusts only its lightness, moving away from the background until the target ratio is reached. It shows a suggestion for AA (4.5:1) and for AAA (7:1). If no lightness of your hue can reach the target, it offers black or white when that works.

    Is this color contrast checker free and private?

    Yes. The tool is free, needs no signup and adds no watermark. Your colors are checked in your browser, so the values you enter are not uploaded to our servers.

    ADVERTISEMENT
    Demo Ad 728 x 90 320 x 100