InputTestHub

Contrast Palette Grid

Builds a contrast matrix for a whole palette and marks each pair as safe for body text, large text, interface elements or nothing at all.

Colour & Design Nothing uploaded No sign-up Free, unlimited
Colour & Design tool
One per line. A name before the colour is optional — Ink #111214 or just #111214.
Fill in the fields and press Generate.
In short A contrast grid takes a whole palette and tests every colour against every other one, marking each pair as safe for body text, large text, interface elements or nothing. Checking pairs one at a time answers the question you thought to ask; checking the full matrix answers the ones you did not — and the pair that fails is almost always a combination nobody deliberately chose, like a muted label on a tinted card, or a border that only appears in one state. The thresholds are the WCAG ones: 4.5:1 for body text at AA, 3:1 for large text at 24px or 18.66px bold, 3:1 for interface components and meaningful graphics under criterion 1.4.11, and 7:1 for AAA. The interface figure is the one most often missed, because people check their text and never check their input borders or their focus rings. Two honest limits. The ratio is a luminance calculation and knows nothing about hue, so it will approve two colours of similar brightness and very different colour as identical, and it will fail some pairs that read perfectly well. And a grid past about fourteen colours stops being readable, which is usually a sign the palette itself needs trimming.

How to use the Contrast Palette Grid

  1. Fill in the fields with your own details.
  2. The generated code updates live in the output panel.
  3. Copy the code and paste it into your page, file or CMS.

About the Contrast Palette Grid

The Contrast Palette Grid builds a contrast matrix for a whole palette and marks each pair as safe for body text, large text, interface elements or nothing at all. It runs as plain JavaScript inside the page, which means there is no upload step, no queue and no size limit imposed by a server — the only limit is your own device.

What people use it for

  • Deciding which combinations a design system permits.
  • Checking a palette before it is committed to tokens.
  • Finding the pair nobody thought to test.

Details

Body text AA4.5:1
Large text AA3:1 — 18.66px bold or 24px
Interface AA3:1, criterion 1.4.11
Body text AAA7:1
SymmetricOrder does not change the ratio

The maths behind it

This tool uses contrast ratio is (L1 + 0.05) ÷ (L2 + 0.05) on relative luminance, computed for every unordered pair in the palette. Every intermediate value is shown on screen, so the result can be checked by hand.

Contrast ratio is a blunt instrument. It measures luminance only, so two colours of very different hue and identical luminance score 1:1 and are genuinely unreadable together — which the number correctly reflects, but it also means a passing ratio does not guarantee comfortable reading. Check the result with real text at real size.

Where this tool stops

Up to fourteen colours, because beyond that the grid stops being readable. It also assumes flat opaque colours; anything over a gradient, an image or a translucent layer has to be checked against the actual rendered pixels.

Frequently asked questions

Why check every pair instead of the ones I use?
Because a design system is a promise about which combinations are allowed, and the pair that fails is reliably one nobody thought to test — the muted text on the tinted card, the accent on the alert background. A grid takes the guessing out of it.
What counts as large text?
18.66px and bold, or 24px and above. At those sizes the AA threshold drops from 4.5:1 to 3:1 because thicker strokes are easier to resolve. It is a real allowance and worth using, but it applies to the rendered size — not to text you intend to be large.
Does the Contrast Palette Grid cost anything?
There is no cost and no cap. The Contrast Palette Grid is not a demo of a paid product, so nothing is held back or watermarked.
Is what I paste into the Contrast Palette Grid stored?
No. The Contrast Palette Grid runs entirely in your browser using JavaScript. Nothing is transmitted, logged or stored, which you can verify yourself in the Network tab of your browser's developer tools.
What formula does the Contrast Palette Grid use?
It uses contrast ratio is (L1 + 0.05) ÷ (L2 + 0.05) on relative luminance, computed for every unordered pair in the palette. The full working is printed under the result, so you can follow every step rather than trusting a black box.
What is the Contrast Palette Grid used for?
Typical uses: deciding which combinations a design system permits. Checking a palette before it is committed to tokens. Finding the pair nobody thought to test. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
What are the limits of the Contrast Palette Grid?
Up to fourteen colours, because beyond that the grid stops being readable. It also assumes flat opaque colours; anything over a gradient, an image or a translucent layer has to be checked against the actual rendered pixels. Knowing where a tool stops being trustworthy matters more than the cases where it works.
What are the reference figures here?
Body text AA is 4.5:1. Large text AA is 3:1 — 18.66px bold or 24px. Interface AA is 3:1, criterion 1.4.11. These are printed on the page itself, so you do not have to take them on trust.
Can I use the Contrast Palette Grid on mobile?
Yes. The page is responsive and the page works in Chrome, Safari, Firefox, Edge and Samsung Internet on both Android and iOS. There is no app to install and nothing to sign into.

Related colour & design tools

All 33
01

CSS Gradient Generator

Builds linear, radial and conic CSS gradients with multiple stops, live preview and copyable…

02

Box Shadow Generator

Builds CSS box shadows with multiple layers, live preview and copyable output including inset…

03

Text Shadow Generator

Creates CSS text shadows including outline, emboss, neon and long-shadow effects.

04

Border Radius Generator

Builds CSS border-radius including per-corner and elliptical values, with a live preview.

06

Neumorphism CSS Generator

Generates soft-UI shadows where an element appears extruded from or pressed into the background.

07

Cubic Bezier Generator

Builds CSS easing curves with a draggable preview and a library of standard easings.

08

CSS Filter Generator

Builds CSS filter chains — blur, brightness, contrast, grayscale, hue-rotate, invert…

09

CSS Transform Generator

Builds CSS transforms — translate, rotate, scale, skew and 3D perspective — with a live preview.

10

Flexbox Generator

Builds flexbox layouts visually and outputs the CSS, with every alignment and wrapping option…