How to use the colour code converter
- Type or paste a colour: #2E8B57, rgb(46, 139, 87), hsl(146, 50%, 36%), cmyk(67, 0, 37, 45) or a CSS name like seagreen. Or use the picker.
- Read every format at once and press Copy next to the one you need. Alpha (opacity) carries through to HEX8, rgba() and hsla().
- Check the contrast on white and black, and click a tint or shade to convert that colour instead.
What each format means
- HEX (#RRGGBB): red, green and blue as two hexadecimal digits each, 00 to FF. Used in HTML, CSS and most design tools.
- RGB: the same three channels as numbers from 0 to 255.
- HSL: hue (0–360° around the colour wheel), saturation and lightness in %. Easy to adjust by hand: raise the lightness for a paler version.
- HSV / HSB: hue, saturation and value (brightness), as in Photoshop's and Figma's colour pickers.
- CMYK: cyan, magenta, yellow and black ink in %, for print.
- OKLCH: lightness, chroma and hue in a perceptual space, written as CSS oklch().
- Integer and Android ARGB: the 24-bit number some code and chat apps use for colours, and the #AARRGGBB form Android uses.
Worked example: sea green
#2E8B57 is rgb(46, 139, 87). The largest channel is green (139), so the hue sits in the green-cyan part of the wheel at 146.5°. Lightness is the average of the largest and smallest channels, (139 + 46) ÷ 2 ÷ 255 = 36.3%. For CMYK, K = 1 − 139/255 = 45.5%, and C = (1 − 46/255 − 0.455) ÷ (1 − 0.455) = 66.9%. Its contrast is 4.24:1 on white and 4.94:1 on black, so black text reads slightly better on it.
Formulas: CSS Color Module Level 4 (HSL, HSV and OKLCH via OKLab by Björn Ottosson) and WCAG 2.2 contrast. Everything runs in your browser.