Technology· Tools for builders
Convert colours between HEX, RGB and HSL, with WCAG contrast against white and black.
Formula
HEX ↔ RGB (base 16); HSL from RGB; contrast = (L1 + 0.05) ÷ (L2 + 0.05)
Worked example
#0f766e is rgb(15, 118, 110), hsl(175, 77%, 26%), with 5.47:1 contrast on white.
Free to use with a link back. Nothing you type is shared.
Preparing citation…
Keep exploring
Generate a fluid CSS clamp() value that scales between two screen widths.
Open calculatorConvert integers between binary, octal, decimal and hexadecimal exactly, even for very large numbers.
Open calculatorReduce image or screen dimensions to their simplest whole-number ratio.
Open calculator