Contrast Test

Contrast Test alternates your full screen between pure black, pure white, and a high-contrast checkerboard so you can judge how much separation your display holds between its darkest and brightest output. Click Start Contrast Test and cycle through each pattern with the arrow keys, watching in particular whether the checkerboard squares stay crisp and distinct rather than washing into gray. The run a gamma test works on any screen — laptop, external monitor, or TV — with nothing to install.

Click Start Contrast Test to cycle through pure black, pure white, and a checkerboard pattern. Watch how distinct the dark and light areas stay from each other. Use the arrow keys or on-screen controls to move to the next pattern, and Escape to exit.

Running a contrast test on your color choices gives you an instant, objective answer to one of the most important questions in accessible design: can your users actually read what you've written? Whether you're fine-tuning body copy on a marketing page or locking in button label colors for a complex user interface, the contrast checker above calculates the precise contrast ratio between your foreground color and your background color, then maps that number against WCAG thresholds so you know — without guessing — whether your design will pass an accessibility audit.

What Is a Contrast Test and How the Contrast Checker Calculates Your Result

Color contrast is measured using a formula rooted in relative luminance — the perceived brightness of each color as a human eye processes it. The contrast ratio ranges from 1:1 (no contrast at all, such as white text on a white background) up to 21:1 (maximum contrast, such as black text on a white background). That ratio ranging from 1 to 21 is the universal currency of colour contrast evaluation across every major accessibility standard.

How the Contrast Ratio Formula Works

The tool derives each color's relative luminance from its RGB channel values, converting them from the hex color (or rgb hexadecimal) you provide. The relative luminance \(L\) for a given color is:

$$L = 0.2126 \cdot R_{lin} + 0.7152 \cdot G_{lin} + 0.0722 \cdot B_{lin}$$

where each linearized channel value \(C_{lin}\) is calculated from its 8-bit sRGB value \(C_{sRGB}\) (normalized to 0–1) as:

$$C_{lin} = \begin{cases} \dfrac{C_{sRGB}}{12.92} & \text{if } C_{sRGB} \leq 0.04045 \\ \left(\dfrac{C_{sRGB} + 0.055}{1.055}\right)^{2.4} & \text{if } C_{sRGB} > 0.04045 \end{cases}$$

Once you have the relative luminance of the lighter color \(L_1\) and the darker color \(L_2\), the final contrast formula is:

$$\text{Contrast Ratio} = \frac{L_1 + 0.05}{L_2 + 0.05}$$

This is the color formula defined by the Web Content Accessibility Guidelines (WCAG) and it is the same calculation baked into every reputable colour checker and contrast analyser on the web. You supply a valid hex colour (alpha value optional) or use the built-in color picker to select your foreground colour and background colour, and the checker does the rest instantly.

The Web Content Accessibility Guidelines — specifically WCAG 2.0 and the updated WCAG 2.1 — set internationally recognized web standards for digital readability. They define two conformance levels relevant to contrast testing: AA (minimum contrast) and AAA (enhanced contrast). Meeting these accessibility guidelines is a legal and ethical baseline for web accessibility in most jurisdictions.

Understanding Pass/Fail Results With a Color Contrast Checker: Normal Text, Large Text, and UI Components

Once your contrast ratio is calculated, the color contrast checker evaluates it against four distinct criteria drawn from WCAG accessibility standards. Understanding which threshold applies to your specific element is critical — a pass for one category does not guarantee compliance across all of them. Use the free free calibration wizard to work through each step in a few clicks.

  • Normal text — WCAG AA (aa normal): 4.5:1 is the minimum contrast ratio required. This applies to standard body copy, labels, and any small text below the large-text threshold. Missing this means your content will likely fail an accessibility audit.
  • Normal text — WCAG AAA (aaa normal): A ratio of 7:1 is required for enhanced compliance. This level is recommended for text that must remain readable for users with moderate visual impairments and severe color blindness.
  • Large text — WCAG AA (aa large): A 3:1 ratio is sufficient. Large text is defined as 18pt (typically 24px) or larger for regular weight, or 14 point (typically 18.66px) and bold text or larger.
  • Large text — WCAG AAA (aaa large): A ratio of 4.5:1 is required for AAA pass at large size — the same threshold that applies to normal text at AA level.
  • Graphical objects and user interface components — WCAG AA: A 3.0:1 ratio applies to icons, charts, form input borders, and other ui components that convey meaningful information. This is the same threshold as AA large text.

Your results display as a clear pass fail indicator for each category: aa pass or fail, and aaa pass or fail, for both normal text and large text breakpoints. The graphical objects category shows a separate AA result, since AAA is not defined for non-text elements under WCAG level AAA.

Understanding the difference between WCAG level AA and AAA matters practically. Most wcag compliance requirements in legal frameworks (such as Section 508 in the US or EN 301 549 in the EU) mandate AA compliance as the floor. AAA compliance is aspirational and applies where your audience includes people with significant visual impairment or disability. When in doubt, aim for AA at minimum and AAA wherever your typography and colour palette allow.

How to Find Colours That Pass: Tips, the Colour Contrast Analyser, and Building Accessible Palettes

Knowing your ratio fails is only half the work — the real goal is finding colours that pass without sacrificing your visual design intent. Here are the most reliable strategies for finding colors that satisfy wcag standards while preserving brand identity and color harmony.

Using the Colour Contrast Analyser (CCA) for Background Color and Screen Sampling

The Colour Contrast Analyser (CCA) is a free desktop application available for Windows and macOS. It lets you sample any background color or foreground background pair directly from your screen using a system-level eyedropper — making it ideal for auditing colors inside native apps, PDFs, or presentations that a browser-based contrast checker cannot access. The CCA displays aa and aaa results instantly and also includes a color blindness simulation mode so you can evaluate text readable legibility for users with deuteranopia, protanopia, and other conditions. It complements online tools perfectly as a desktop-first contrast analyser for comprehensive accessibility testing.

Coolors Adobe Extension for Large Text and Palette-Level Checking

The Coolors Adobe Extension integrates directly into Adobe Creative Cloud apps, letting you evaluate colour combinations and color combinations real time as you design. Instead of exporting hex codes and testing them one by one, you get instant contrast level feedback within your design workspace. The extension connects to Coolors' full suite of tools — including generate palettes, explore palettes, palette visualizer, extract palette, extract color gradient, and the interactive color wheel — giving you access to over 10 million color schemes as a starting point for accessible visual design. You can maintain unlimited palettes and save up to 10 palettes of 5 colors each in the base tier, with expanded options on paid plans.

When building a custom color palette from scratch, following a structured workflow leads to better results:

  1. Choose a base color that aligns with your brand — this anchors your color scheme.
  2. Select a color harmony type — complementary, analogous colors, triadic colors, split-complementary, or monochromatic — to generate a structured color scheme via the color wheel.
  3. Preview your palette using a palette preview tool and simulate how the colour values appear under different color blindness simulation modes.
  4. Run a contrast test on every foreground/background pairing in your color palette — not just the primary text. Check ui color pairings for buttons, links, and form input borders against the 3.0:1 minimum.
  5. Adjust using the lightness slider — dragging toward darker values on the foreground colour or lighter values on the background colour is the fastest way to lift a failing ratio without changing hue or saturation.
  6. Adjust color stops along the gradient or wheel to fine-tune a color gradient while maintaining perceived lightness separation between layers.

Once you've identified a passing combination, use copy to clipboard to capture the exact hex colour or RGB value. You can also save a permalink to any checked pair so your team can reference it during wcag compliance reviews — no re-entering values needed.

For link contrast specifically, standard body contrast checks are not sufficient. Use a dedicated link contrast checker to evaluate links that are distinguished from surrounding text using color alone — WCAG requires a 3:1 contrast ratio between the link text color and the surrounding body text contrast, in addition to the standard foreground color vs background colour check.

Below is a quick reference of worked examples showing example copy at representative colour combinations, demonstrating how the pass fail result changes dramatically based on your choices. Each example follows the contrast ratio calculation described above.

  • Black text on white (#000000 on #FFFFFF): Relative luminance of white = 1.0, black = 0.0. $$\text{Ratio} = \frac{1.0 + 0.05}{0.0 + 0.05} = \frac{1.05}{0.05} = 21:1$$ Result: aa normal pass, aaa normal pass, aa large pass, aaa large pass. This is the theoretical maximum — perfect text readability and readable design for every user including those with significant visual impairments.
  • Light gray text on white (#AAAAAA on #FFFFFF): The background rgb is (255, 255, 255) and the foreground is (170, 170, 170). This yields a ratio of approximately 2.32:1 — well below the 4.5:1 threshold for normal text AA and even below the 3:1 threshold for large text AA. Result: fails all four categories. A common mistake in web design, especially for placeholder text, captions, and fine print. Increasing the lightness separation — darkening the foreground background pair — is the fix. This combination also worsens significantly for users with color blindness.
  • Dark blue on light blue (#1A237E on #E3F2FD) — UI component / large text borderline: This pairing produces a ratio close to 3.0:1, which means it sits right at the boundary for aa large and the graphical objects / user interface components threshold. It would pass for large text (18pt/24px or 14pt bold) and for interface elements like button borders, but it fails aa normal for standard body copy. This is a realistic ui color scenario for button labels in a branded blue palette. To remediate accessibility, darken the foreground or lighten the background until the ratio reaches 4.5:1 for body text use.

Developer Integration, Pro Features, and Support: Using the Contrast Checker API

For teams embedding contrast testing into automated workflows, the contrast checker API makes programmatic evaluation straightforward. This tool functions as a basic API — simply append &api to any permalink URL to receive a JSON object containing the calculated contrast ratio and the complete AA/AAA pass fail states for all four categories. For example:

https://webaim.org/resources/contrastchecker/?fcolor=0000FF&bcolor=EEEEEE&api

This makes it easy to integrate colour contrast checking into CI/CD pipelines, design system documentation, or accessibility audit scripts that validate page text elements across an entire web page automatically. The response includes the numeric ratio and boolean pass/fail flags you can use to block deploys or flag violations in your component library.

A contrast checker bookmarklet is also available for browser-based on-the-fly testing. Installing the bookmarklet places a miniature version of the checker directly in your browser toolbar. Click it while viewing any live site and use the foreground and background eyedropper tools to sample colour values from real web page elements — including dynamically rendered content that standard accessibility scanners sometimes miss. The bookmarklet is particularly useful for quick spot-checks during web design reviews or client presentations.

Beyond the free tools, a pro profile unlocks features designed for teams doing serious digital accessibility work and inclusive design at scale. Pro benefits include advanced pdf export for accessibility reports, access to unlimited palettes for storing and organizing every approved color combination, and 1 project and 1 collection management features for keeping your accessible colour combinations organized by brand or client. You can also remove the ads that appear on the free interface by upgrading — just click remove ads in your account settings. If your needs change, you can cancel your subscription anytime with no penalty. To support me and keep these tools free for the broader web accessible design community, upgrading to a paid plan is the most direct way to contribute. For questions, billing issues, or feature requests, contact information is available through your account dashboard — look for the create now button on the pro upgrade page to get started.

Comprehensive web content accessibility work goes beyond a single colour checker pass. Tools like WAVE can evaluate contrast level across every element of a live page simultaneously, flagging color ratio failures for aa standard and aaa standard compliance in bulk. Combining an automated scanner with manual evaluation using this calculator — especially for edge cases like transparency, alpha value adjustments, and hsl color spaces — gives you the most complete picture of your site's usability and visual accessibility before launch. Integrating web content accessibility guidelines compliance into your design process from the start — not as an afterthought — is the hallmark of truly accessible design and color theory-informed web standards practice. For any typeface and any 16px base size, if your colour choices pass AA, you've built a foundation that serves users across the full spectrum of visual ability, including those with color blindness, low vision, or other disability-related needs — and your legibility will hold even as display conditions vary across devices and environments.

Frequently Asked Questions

What is a contrast ratio and how is it calculated?
A contrast ratio measures the difference in luminance between two colors, expressed as a ratio like 4.5:1. It is calculated using the WCAG formula: (L1 + 0.05) / (L2 + 0.05), where L1 is the relative luminance of the lighter color and L2 is the relative luminance of the darker color. Ratios range from 1:1 (no contrast) to 21:1 (black on white).
What are the WCAG AA and AAA contrast requirements?
WCAG 2.1 Level AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18pt or 14pt bold). Level AAA requires at least 7:1 for normal text and 4.5:1 for large text. UI components and graphical objects must meet a minimum of 3:1 under WCAG 2.1 AA.
What counts as 'large text' for WCAG purposes?
Large text is defined as at least 18pt (approximately 24px) in regular weight, or at least 14pt (approximately 18.67px) when bold. Text larger than these sizes has a lower contrast requirement because it is inherently easier to read.
Why should I care about color contrast accessibility?
Insufficient color contrast makes text and UI elements difficult or impossible to read for people with low vision, color blindness, or other visual impairments. Meeting WCAG standards also helps in bright sunlight conditions and on low-quality displays. Many jurisdictions require WCAG compliance for public-facing websites by law.
What hex format should I enter for the colors?
Enter standard 6-digit hexadecimal color codes, such as #1e3a5f or #ffffff. You can use the color picker to choose a color visually. Both the foreground (text) color and background color must be specified to calculate the contrast ratio.
Does color contrast apply to images or decorative elements?
WCAG contrast requirements apply to meaningful text, text in images, and interactive UI components such as input borders and icons that convey information. Purely decorative images or elements that serve no functional purpose are exempt from contrast requirements.
How can I find a color combination that passes WCAG?
If your colors fail, try darkening the foreground color or lightening the background (or vice versa) until the ratio meets the required threshold. Tools like this checker let you iterate quickly. As a general rule, very dark text on very light backgrounds and vice versa reliably achieve high contrast ratios.
Does this tool check WCAG 2.0 or WCAG 2.1?
This tool checks against WCAG 2.1, which includes the contrast requirement of 3:1 for UI components and graphical objects added in that version. The core text contrast requirements (AA and AAA) are the same as WCAG 2.0, so results are valid for both standards.