Color Converter: Convert CSS Colors and Check Contrast
Paste a CSS color (hex, rgb/rgba, hsl/hsla, or a named keyword), inspect channel math and optional alpha, check WCAG contrast against black and white, and copy ready-to-use CSS. Conversion runs entirely in your browser.
Color input
Examples: #3b82f6, rgb(59 130 246 / 0.8), hsl(217 91% 60%), tomato, #f008
Enter a CSS color to convert.
Preview and channels
Color preview
| Channel | Value |
|---|
Channel math
Copyable CSS
Modern space-separated syntax is preferred; legacy comma forms are included for older stylesheets.
WCAG contrast vs black and white
Relative luminance and contrast ratio follow WCAG 2.x for sRGB. When alpha is below 1, the color is composited onto the comparison background before measuring. Thresholds: AA normal 4.5:1, AA large 3:1, AAA normal 7:1, AAA large 4.5:1.