Color Contrast Grid
Paste a palette and get every foreground-on-background contrast ratio in one matrix, colour-coded by WCAG pass level and exportable as CSV or Markdown.
Every pair, scored against 4.5:1
| FG \ BG | #ffffff | #f8fafc | #e2e8f0 | #94a3b8 | #475569 | #0f172a | #3b82f6 | #ef4444 |
|---|---|---|---|---|---|---|---|---|
| #ffffff | — | Aa1.0 | Aa1.2 | Aa2.6 | Aa7.6 | Aa17.9 | Aa3.7 | Aa3.8 |
| #f8fafc | Aa1.0 | — | Aa1.2 | Aa2.5 | Aa7.2 | Aa17.1 | Aa3.5 | Aa3.6 |
| #e2e8f0 | Aa1.2 | Aa1.2 | — | Aa2.1 | Aa6.1 | Aa14.5 | Aa3.0 | Aa3.1 |
| #94a3b8 | Aa2.6 | Aa2.5 | Aa2.1 | — | Aa3.0 | Aa7.0 | Aa1.4 | Aa1.5 |
| #475569 | Aa7.6 | Aa7.2 | Aa6.1 | Aa3.0 | — | Aa2.4 | Aa2.1 | Aa2.0 |
| #0f172a | Aa17.9 | Aa17.1 | Aa14.5 | Aa7.0 | Aa2.4 | — | Aa4.9 | Aa4.7 |
| #3b82f6 | Aa3.7 | Aa3.5 | Aa3.0 | Aa1.4 | Aa2.1 | Aa4.9 | — | Aa1.0 |
| #ef4444 | Aa3.8 | Aa3.6 | Aa3.1 | Aa1.5 | Aa2.0 | Aa4.7 | Aa1.0 | — |
Each cell renders the row colour as text on the column colour as background. A green border means the pair reaches 4.5:1; faded cells fall short.
Export for your design-system docs
What is the Color Contrast Grid?
Checking colours in pairs is how contrast bugs slip through — you verify the combinations you thought of and ship the ones you did not.
- Every foreground-and-background pair scored in one matrix
- Live text sample rendered inside each cell
- Switch between AA, AA large, AAA and 3:1 UI thresholds
- Pass-rate summary across the whole palette
- CSV and Markdown export for design-system docs
- Reads hex codes out of pasted CSS automatically
How to use the Color Contrast Grid
- 1
Paste your palette into the text area — one hex per line, or any CSS containing hex values.
- 2
Choose which conformance level to highlight: AA normal, AA large, AAA or non-text UI.
- 3
Read the matrix; each cell shows sample text on that background with its ratio.
- 4
Download or copy the grid as CSV or Markdown for your documentation.
About the Color Contrast Grid
Checking colours in pairs is how contrast bugs slip through — you verify the combinations you thought of and ship the ones you did not. This tool takes a whole palette and scores every possible pairing at once, so the gaps are visible before anyone builds a component with them.
Paste hex values one per line, or drop in a block of CSS custom properties and the hex codes get pulled out automatically. Each cell renders the row colour as text on the column colour as a background, with its WCAG 2.1 ratio underneath and a green border when it clears the level you selected.
Switch between AA normal text, AA large text, AAA and the 3:1 non-text UI threshold to see how the same palette performs against each. Export the matrix as CSV or Markdown to paste straight into your design-system documentation. All of it runs in your browser with nothing uploaded.
Frequently asked questions
How many colors can I put in the grid?
Up to 24. Beyond that the matrix stops being readable on any screen, so extra colours are ignored and the tool tells you it truncated. If you have a bigger palette, split it into the neutrals and the accents and run each separately.
What contrast ratio does WCAG require?
AA needs 4.5:1 for normal text and 3:1 for large text, which means 18.66px bold or 24px regular. It also needs 3:1 for user-interface components and meaningful graphics. AAA raises normal text to 7:1 and large text to 4.5:1.
Why is the grid symmetric?
Because the WCAG 2.1 formula divides the lighter relative luminance by the darker one, so swapping foreground and background gives the same ratio. If you need a polarity-aware score, use an APCA checker instead — APCA deliberately treats the two directions differently.
Does a passing contrast ratio guarantee readability?
No. The ratio ignores font size below the large-text cutoff, font weight, letter spacing and the amount of surrounding colour. Treat a pass as the floor rather than the goal, and always look at the rendered sample as well as the number.
Can I use this for a design system audit?
That is exactly what the export is for. Drop your token values in, pick your target level, and paste the Markdown table into your documentation so every contributor can see which pairings are approved without recalculating anything.
Related tools
Contrast Checker
Check the contrast ratio between text and background colors against WCAG AA and AAA standards. Live preview, pass/fail badges and a one-click color swap.
Accessible Color Finder
Find the nearest colour that passes WCAG contrast by adjusting only OKLCH lightness, so your brand hue survives while the text becomes readable.
APCA Contrast Checker
Calculate the APCA lightness contrast (Lc) for any text and background pair, with the draft WCAG 3 font size and weight lookup and a live preview.
Dark Mode Palette Generator
Map a light-theme palette to its dark counterpart by inverting OKLCH lightness within bounds you set, then re-check every pairing for 4.5:1 contrast.
Color Palette Generator
Generate complementary, analogous, triadic, tetradic and monochromatic color palettes from any base color. Click any swatch to copy its HEX code fast.