AA Gradient Calculator

Check whether a gradient meets WCAG AA contrast requirements for readable text and accessible design.

Sample Text

What This Gradient Contrast Checker Does

This tool evaluates whether a gradient meets the WCAG AA contrast ratio of 4.5:1 for normal text or 3:1 for large text. Gradients present a unique accessibility challenge because contrast levels shift across the color transition. A single point check at the start or end of the gradient is often misleading. This calculator samples multiple points along the gradient to identify the minimum contrast ratio, giving you a reliable pass or fail result for the entire gradient.

How the Gradient Contrast Check Works

The tool calculates contrast using the WCAG 2.1 relative luminance formula. For a gradient defined by two colors, the calculator:

The minimum ratio determines the pass or fail result. If any point along the gradient falls below the required threshold, the gradient fails WCAG AA compliance for that text size.

How to Use the AA Gradient Calculator

  1. Select the gradient colors. Enter the start and end colors of your gradient. You can use hex, RGB, or HSL values.
  2. Choose the text color. This is the color of the text that will be placed over the gradient.
  3. Select the text size. Choose between normal text (under 18px or 14px bold) and large text (18px and above or 14px bold and above). The threshold changes from 4.5:1 to 3:1 for large text.
  4. Run the check. The tool will sample the gradient and display the minimum contrast ratio and a pass or fail result.

Example: Checking a Gradient for Readable Text

Suppose you have a gradient from #4A90D9 (blue) to #50E3C2 (teal) and you want to place white text over it. You run the check for normal text (4.5:1 threshold). The tool samples the gradient and finds that the contrast ratio drops to 3.2:1 near the teal end. The result is a fail. To fix this, you could darken the teal end of the gradient or use a darker text color.

Understanding Your Results

The output shows:

A pass means the entire gradient is safe for that text color and size. A fail means at least one section of the gradient does not meet the minimum contrast requirement.

Common Mistakes When Checking Gradient Contrast

Limitations of This Tool

Practical Use Cases

Frequently Asked Questions

What is WCAG AA contrast ratio?

WCAG AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18px and above, or 14px bold and above). This is the minimum standard for most public and enterprise websites.

Can a gradient pass for large text but fail for normal text?

Yes. Large text has a lower threshold (3:1), so a gradient that fails for body text may still be acceptable for headings or large buttons. Always check against the correct text size.

Does this tool support multi-stop gradients?

This version checks two-color gradients. For gradients with three or more color stops, the contrast variation can be more complex. You can check each segment separately or use a tool that supports multi-stop sampling.

What if my gradient uses transparency?

Transparency affects the perceived color because the background shows through. For accurate results, enter the actual rendered color values, not the raw gradient colors. If the gradient overlays a background image or pattern, the contrast check becomes more complex and may require manual testing.

Is WCAG AA enough for accessibility?

WCAG AA is a legal and industry standard for most contexts. However, WCAG AAA (7:1 for normal text) provides better readability for users with low vision. Consider your audience and content criticality when setting contrast targets.