OKLCH Contrast Checker: Test WCAG AA and AAA Colors with Perceptual Sliders
Check WCAG 2.x contrast ratios with live OKLCH controls, AA/AAA pass badges, and OKLab Delta-E β free and fully in-browser.
Table of Contents
Color contrast is one of the most common accessibility failures on the web β and one of the easiest to fix, if you can see the problem while you are still choosing colors. The OKLCH Contrast Checker gives you a live WCAG 2.x contrast testing environment built around OKLCH, the perceptual color space that modern CSS now supports natively.
Instead of nudging hex codes and re-checking, you adjust Lightness, Chroma, and Hue with dedicated sliders for both the foreground and background, and the contrast ratio updates instantly. Pass or fail badges for every WCAG level appear the moment the numbers change, so there is no guessing whether your text pair clears AA or AAA.
Everything runs entirely in your browser. No color data is uploaded, no account is needed, and the tool is free. In this guide, we'll walk through how it works, what the numbers mean, and how to fold it into your design and review workflow.
Why Use the OKLCH Contrast Checker?
- Perceptual sliders, not guesswork. Because OKLCH Lightness tracks how human vision actually perceives brightness, moving the L slider changes contrast in a predictable, nearly linear way. You stop fighting surprises like "I darkened the color but the ratio barely moved."
- Every WCAG 2.x threshold at a glance. The tool checks AA for normal text (4.5:1), AA for large text (3:1), AAA for normal text (7:1), AAA for large text (4.5:1), and the 3:1 requirement for UI components and graphical objects β all in one panel.
- OKLab Delta-E alongside the WCAG ratio. The contrast ratio tells you about legibility thresholds; the OKLab ΞE value tells you the perceptual distance between the two colors. Having both helps you reason about edge cases the ratio handles poorly.
- Realistic live preview. Large headline text, body copy, small print, and both filled and outline button samples render with your chosen pair, so you judge real interface elements rather than abstract swatches.
- Built for the modern CSS workflow. The tool reads and displays oklch() notation directly, such as oklch(0.98 0.005 250), which you can copy straight into your CSS or design tokens.
- Private and instant. In-browser computation means zero latency and zero data leaving your machine β useful when you're working with unreleased brand palettes.
Key Features
| Feature | What it does |
|---|---|
| OKLCH sliders (L, C, H) | Adjust Lightness, Chroma, and Hue independently for foreground and background |
| WCAG 2.x compliance panel | Live pass/fail for AA normal, AA large, AAA normal, AAA large, and UI/graphics |
| OKLab Delta-E readout | Shows the perceptual distance (ΞE) between foreground and background |
| Live sample preview | Headline, body, small print, and button/outline samples in your color pair |
| Swap button | Flip foreground and background with one click |
| OKLCH notation readout | Copy-ready oklch(L C H) values for CSS and design tokens |
The dual-slider design is the heart of the tool: one full L/C/H control set for text color, another for the background. A useful technique is to lock in your background and walk the foreground Lightness down until every badge turns green β the lowest L that passes AAA is usually your most aesthetically balanced choice.
The Delta-E readout adds a second lens. Two pairs can both pass AA while feeling very different in practice; ΞE quantifies that difference perceptually, which is especially helpful when you're comparing candidate pairs or tuning large-text thresholds.
How to Use It
- Open the OKLCH Contrast Checker β the tool loads with a foreground/background pair already loaded so you can see the mechanics immediately.
- Set your background color using its Lightness, Chroma, and Hue sliders (or start from the current values and adjust).
- Adjust the foreground sliders, watching the contrast ratio and compliance badges update in real time.
- Check the results panel: confirm AA and AAA status for your text sizes, and note the OKLab ΞE value for the perceptual gap.
- Review the live preview for large text, body text, small print, and buttons; hit Swap to verify the inverse pairing, then copy the oklch() values into your CSS.
Understanding OKLCH and WCAG Contrast
OKLCH is a cylindrical form of OKLab, a color space designed so that equal numeric steps correspond to equal perceived differences. The three channels map cleanly to intuition: L (Lightness) runs from 0 (black) to 1 (white), C (Chroma) is saturation from gray (0) outward, and H (Hue) is the angle around the color wheel in degrees.
This matters for contrast work because WCAG 2.x contrast ratios are computed from relative luminance, which compresses dark tones together. In sRGB or HSL, visually distinct dark colors can have nearly identical luminance, so a small hex change sometimes barely moves the ratio. In OKLCH, dropping Lightness by a fixed step produces a consistent, predictable contrast change β which is why the sliders make tuning so much faster. It's also why CSS Color Level 4 adopted oklch(): designers can build palettes that look evenly spaced to humans.
The WCAG thresholds themselves are ratio-based. 4.5:1 is the AA floor for normal text (roughly 18px and below, or 14px bold). 3:1 applies to large text β at least 24px, or 18.66px bold β and also to meaningful UI components and graphical objects like input borders and icons. 7:1 is AAA for normal text, and 4.5:1 is AAA for large text. Many teams treat AAA as the target for body copy because it comfortably covers low-vision users, older displays, and bright ambient light.
So where does OKLab Delta-E fit in? The WCAG ratio is a threshold check derived from luminance; it says nothing about how different two colors look overall. ΞE measures the perceptual distance across all channels β hue and chroma included. A pair of colors can share a similar ratio but differ widely in ΞE, and vice versa. When you're deciding between two passing pairs, or judging whether a 3:1 large-text pairing still "feels" sufficiently distinct, ΞE gives you a number for that judgment. It's a complement to the ratio, not a replacement.
Practical Use Cases
Auditing a design system's color tokens
Design systems accumulate text-on-surface pairs across primary, muted, disabled, and inverse styles. Paste each token pair's OKLCH values into the checker and record which level each pair passes. Anything failing AA for its intended use gets flagged for a Lightness adjustment β often a one-step L change fixes it without visibly shifting the brand feel.
Building dark mode pairings
Dark mode is where contrast failures cluster: surfaces darken, but brand text colors often stay the same. Set your dark surface as the background, bring your brand hue in as foreground, and lower its Lightness until badges pass. Because OKLCH keeps Chroma and Hue stable while you move L, the adjusted color still reads as the same brand color.
Validating buttons and CTAs
Interactive elements must meet 3:1 for their boundaries and state indicators, and any text inside must meet text thresholds on its own background. Check the pair both ways with the Swap button: label-on-fill for the text requirement, and fill-on-page for the component boundary. The button samples in the live preview show both filled and outline variants, which is exactly the comparison you need.
Pre-launch accessibility review
Before shipping a screen, walk through its key color pairs β body text, secondary text, links, disabled states, and chart accents β and confirm each passes its intended level. It takes minutes with the sliders and catches the failures that automated page scanners miss when colors are set through variables or applied via themes.
Best Practices
- Start from the background, then tune foreground Lightness. Background surface colors are usually the most constrained (brand surfaces, existing theme); foreground L is the highest-leverage dial for hitting a threshold.
- Test at the level your audience needs. AA is the legal floor in most contexts; aim for AAA on body copy where the palette allows it, since aging eyes and cheap displays eat contrast margin.
- Never judge contrast by eye on your monitor alone. Screen calibration, brightness, and ambient light vary enormously β the ratio is the standard precisely because eyeballing is unreliable.
- Check disabled and placeholder states, not just primary text. These subtle grays fail constantly and are easy to overlook because they're deliberately de-emphasized.
- Verify both pair directions with Swap. Some designs render inverse color schemes (hover states, selected rows, badges), and a pair that passes one way can fail the other at large-text thresholds.
- Keep Delta-E in context. Use ΞE to compare candidate pairs and sanity-check perceptual distinctness, but let the WCAG ratio govern compliance decisions.
Check Your Colors Today
Color accessibility doesn't need to be a retrofit β with the right loop, it becomes part of how you choose colors in the first place. Open the OKLCH Contrast Checker, load your foreground and background, and let the sliders and badges guide you to a palette that passes AA and AAA without the guesswork. Your users β including the ones who never tell you they struggled to read your text β will notice the difference.
Related Tools You Might Like:
Happy designing accessible interfaces!