Color Converter
Convert between HEX, RGB and HSL, then check the contrast ratios that matter for accessibility.
AA needs 4.5:1 for body text and 3:1 for large text (18px+ or 14px bold). AAA needs 7:1.
Three ways to describe one color
HEX (#3D5AF1) is how colors are written in CSS and design tools: three pairs of hex digits for red, green and blue. Compact, but not human-readable — you cannot tell by looking that it is a blue.
RGB (rgb(61, 90, 241)) is the same data in decimal, matching how screens mix light. Add an alpha channel and it becomes rgba().
HSL (hsl(230, 86%, 59%)) describes a color as hue, saturation and lightness. This is the model designers actually think in: to make a hover state, lower the lightness; to mute a badge, lower the saturation. Generating a consistent palette is trivial in HSL and painful in HEX.
Perceptual problems with HSL
HSL is not perceptually uniform. Two colors with the same lightness value can look very different in brightness — pure yellow at 50% lightness looks far brighter than blue at 50%. Modern CSS adds oklch() and lab(), which are perceptually uniform, so a lightness step produces a visually even step. If you are building a design system today, OKLCH is worth adopting; HSL remains the easiest mental model for quick tweaks.
Contrast is a hard requirement, not a preference
WCAG 2.2 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18pt, or 14pt bold) at level AA. Level AAA asks for 7:1. The ratio is computed from relative luminance, not from raw RGB values — which is why "just use a darker grey" often fails silently. The checker above reports both directions, because text on a color and the same color as text are different questions.
Transparency and compositing
An alpha channel is not a lighter color: rgba(0,0,0,0.5) over white looks grey, but over blue it looks dark blue. Contrast must be measured against the composited result, so a 50% black label on a photo can pass on one area and fail on another. Test with the real background, not an approximation.
Color and accessibility beyond contrast
Roughly 8% of men have some form of color vision deficiency. Never encode meaning with hue alone — pair it with an icon, a label or a pattern. Red/green status indicators are the classic failure.