Skip to content
← Color Tools

Palette Contrast Matrix

Paste a full palette and get every possible foreground-background contrast ratio in a grid. Find the safe pairs at a glance.

Palette Contrast Matrix

Paste a full palette and get every possible foreground-background contrast ratio in a grid. Find the safe pairs at a glance.

Contrast Checking at the Palette Level

The existing Contrast Checker tests one foreground color against one background color and returns the WCAG ratio with a pass-or-fail verdict. The existing Contrast Batch Checker tests a predefined list of specific pairs you specify. Neither tool answers the question that arises constantly during design system work: given a palette of N colors, which of the N times N possible pairs satisfy WCAG AA for body text, AA for large text, and AAA, and which do not? The Palette Contrast Matrix answers this in a single view. Paste a palette of up to 25 colors and the tool computes the contrast ratio for every possible foreground-background pair, displaying them in a grid where each cell shows the ratio and color-codes pass-or-fail for the four WCAG tiers (AA normal, AA large, AAA normal, AAA large). The result is an at-a-glance map of which pairs in your palette are safe for text, which are safe for icons or large headings only, and which need to be reserved for decorative use. Designers building accessible component libraries refer to this matrix constantly; surfacing it as a tool removes the manual pair-by-pair checking that used to take an hour per palette.

Reading the Matrix

Columns are foreground colors and rows are background colors (the typical text-on-background orientation). Each cell shows the contrast ratio as a number and the WCAG verdict as a colored badge. Green badges indicate AAA compliance (7.0 or above for normal text), blue indicates AA compliance (4.5 or above for normal text, 3.0 or above for large text), yellow indicates AA-large only (3.0 to 4.5), and red indicates failing all WCAG tiers. The diagonal of the matrix (same color foreground and background) is ignored since the ratio is always 1.0. Above and below the diagonal the values are inverted but the verdicts are the same, since WCAG contrast is symmetric. A filter toggle lets you hide failing pairs to focus on the usable subset, or hide passing pairs to focus on which pairs need work. The matrix updates live as you edit the palette, so you can see immediately how adding, removing, or adjusting a color affects the overall accessibility profile of the palette.

Practical Workflows for Design Systems

Build the matrix early in the design system process, before settling on component-level color choices. A palette where only 10 percent of pairs satisfy AA will produce constant accessibility friction during component design; a palette where 40 percent or more satisfy AA gives the freedom to compose accessible components without hand-tuning every pair. The matrix view also surfaces unexpected combinations: pairs you would not have thought to check often turn out to be the highest-contrast options in the palette and become useful for specific cases like skeleton placeholders or focus states. For larger palettes (15 to 25 colors) the matrix grows quickly, so the tool offers a filtered view that shows only the high-contrast subset for quick reference during text-on-background decisions. The full matrix is always available behind a toggle for exhaustive analysis. Output options include a CSV export of the full ratio table and a screenshot-friendly view suitable for inclusion in design system documentation, which is the way most teams want to record the contrast story of their palette.

Frequently Asked Questions

How is this different from Contrast Batch Checker?+
Contrast Batch Checker tests a list of specific foreground-background pairs you specify, which is the right tool when you already know which pairs to test. Palette Contrast Matrix tests every possible pair in a palette automatically, which is the right tool when you want to discover the full contrast story of a palette without specifying pairs upfront.
What is the maximum palette size?+
Twenty-five colors. Beyond that the matrix becomes harder to read on most screens (625 cells) and the practical question shifts from individual pair contrast to aggregate palette statistics, which is a different tool. For typical design system palettes of 6 to 15 colors the matrix view is the optimal scale.
Does the tool check WCAG AA or AAA?+
Both, plus the large-text variants of each. Every cell shows the ratio and color-coded badges for AAA normal, AAA large, AA normal, and AA large compliance. WCAG 2.2 thresholds: AAA normal is 7.0, AAA large is 4.5, AA normal is 4.5, AA large is 3.0. AA large applies to text 24 pixels or larger, or 19 pixels or larger if bold.
Why is the diagonal of the matrix blank?+
Because foreground and background are the same color, the contrast ratio is exactly 1.0 (no contrast). This is never a usable pair, so the diagonal cells are blanked out to reduce visual noise. The number of usable pairs in a palette of N colors is N times (N minus 1), or just under N-squared for large palettes.
Can I export the matrix?+
Yes. The export panel offers three formats: CSV (every pair as a row with foreground, background, ratio, and pass-fail verdict columns), JSON (same data structured for programmatic use), and a styled HTML table suitable for design system documentation. The CSV format is the most common for compliance and audit work.
Does the matrix respect non-color contrast factors?+
No. WCAG contrast is a function of the two colors only and does not account for font weight, anti-aliasing, or surrounding context. The matrix gives you the raw ratio; pair it with judgment for borderline cases where a 4.5 ratio in the matrix may render as marginal on small thin text in practice.
Can I check the matrix for color-blind viewers?+
Contrast ratios are perceptually similar for most color-vision-deficiency types because the WCAG formula uses luminance, which is largely preserved under color-blind transformations. For full color-blind compatibility checking, use the Color Blindness Simulator tool on each pair flagged as borderline by the matrix; together the two tools give complete contrast and color-vision coverage.
How are foreground and background different in the matrix?+
Columns are foreground (the text color) and rows are background (the surface color). For a text-on-button decision, find the row matching the button color and the column matching the text color; the cell at that intersection is the ratio for that specific use. Swapping the two colors gives the same ratio because WCAG contrast is mathematically symmetric, but conceptually the foreground-background distinction matters for design system documentation.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service