RandomA11y
Browse RandomA11y for WCAG contrast-safe pairs and accessible color combinations. Generate random foreground and background sets.
Help Us Improve
—
(—)
Colour contrast analyser for background and foreground pairs. Live WCAG ratio, pass or fail grades, hex RGB and HSL controls, and text preview.
Live contrast ratio
Read the ratio as you edit background and foreground hex values—useful when you contrast compare two directions of the same pair.
WCAG pass or fail grades
AA Large, AAA Large, AA, and AAA rows cover normal text and large type buckets.
Hex, RGB, and HSL inputs
Paste google hex color strings or nudge channels on RGB and HSL tabs when you need repeatable tokens.
Background and foreground preview
The full tool surface updates with your pair so you see an example of contrast on real layout colours.
Readable copy and typeface preview
Large and normal text areas plus optional Google Fonts help judge colourtext readability beyond the Aa swatch.
Reverse and save pairs
Swap layers in one click and store up to six recent background and foreground combinations locally.
Shareable URLs
Background and foreground query parameters reload the same pair for teammates.
Set the background colour first
Start with the surface hex—page section, card, or chrome in a blue color UI design mockup.
Tune the foreground text colour
Adjust the text or icon layer until the ratio and grades match your target WCAG level.
Validate both text size rows
Confirm AA Large and AA normal when headings and body copy share one pair.
Save or share passing hex values
Use Save colours for quick recall or copy the URL with background and foreground parameters.
Test extreme pairs early
White text on black background readability is an easy baseline—flip with Reverse colours to compare both polarities.
Re-check blue accents
Contrast for blue color combinations shifts quickly with lightness; re-run after small saturation tweaks.
Check during palette exploration
Run the analyser while shortlisting swatches from /colorschemer-schemes, not only at final QA.
Use saved swatches for regression
Store approved background and foreground tokens locally after theme refactors.
UI and product designers: Validate colour for text on components, dashboards, and marketing heroes.
Front-end developers: Confirm CSS hex values meet readability targets before merge.
Design system maintainers: Document pre-checked background and foreground tokens with recorded ratios.
Brand and content designers: Preview long copy with Google Fonts when judging colourtext on campaign backgrounds.
Private by default
Ratio math runs locally; colours are not uploaded for analysis.
Clear pass or fail signals
Numeric ratios and grade badges reduce subjective debate in critiques.
Faster validation in one session
Move from palette browsing to contrast compare on the same site.
Honest scope
WCAG 2.x relative luminance—not APCA, not print ink or window tint simulation.
“The visual presentation of text and images of text has a contrast ratio of at least 4.5:1, except for large-scale text and incidental text which require at least 3:1.”
WCAG 2.1 — Contrast Minimum (Success Criterion 1.4.3): This analyser computes the relative-luminance contrast ratio per the WCAG 2.x formula: (L1 + 0.05) / (L2 + 0.05), and displays pass/fail for AA and AAA thresholds at normal and large text sizes. w3.org/TR/WCAG21/#contrast-minimum
“Relative luminance is the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white, based on the sRGB color space and the CIE 1931 luminosity function.”
Relative luminance definition: Each input hex is converted to sRGB linear values, then weighted by the standard luminosity coefficients (0.2126 × R, 0.7152 × G, 0.0722 × B) to compute its relative luminance for the contrast ratio. w3.org/TR/WCAG21/#dfn-relative-luminance
“The HSL color model describes colors in terms of hue, saturation, and lightness, which is more intuitive for humans to reason about than raw RGB values.”
HSL color model for color picking: Users can toggle between hex, RGB, and HSL input modes for both foreground and background, making it easier to adjust lightness directly while preserving hue and saturation. en.wikipedia.org/wiki/HSL_and_HSV