Colour Conversion: HEX, RGB, HSL, CMYK and WCAG Contrast

Open Tool Color Format Converter

What each model is for

HEX is the web notation — six hexadecimal digits where the first pair is red, the second green, the third blue. RGB uses three values from zero to 255 and suits code. HSL describes hue, saturation and lightness, making it the friendliest model for adjusting tone and building palettes. HSV resembles HSL with a different lightness definition and appears in pickers. CMYK is the four-ink print model in percentages. The first three serve screens; the last serves paper.

Steps

  1. Enter a HEX value or sample one from screen with the eyedropper.
  2. Red, green and blue sliders stay in two-way sync with HEX.
  3. Palette scheme offers dark ramp, light ramp, complementary and split complementary, analogous and triadic.
  4. Uppercase HEX and keep-hash control output formatting.
  5. Mix colour with a mix ratio interpolates a midpoint between two colours.
  6. Convert shows every format, Copy value takes one, Export palette takes the set; the contrast panel reports ratio and AA/AAA grade.

Reading WCAG contrast

Contrast ratio derives from relative luminance: the brighter value plus 0.05 divided by the darker plus 0.05. Body text needs 4.5:1 for AA, large text — eighteen points or fourteen bold — needs 3:1, while AAA asks 7:1 and 4.5:1. Non-text elements such as icons, borders and input outlines need 3:1. The number reads luminance only, not hue, so deep blue on pale blue can fail while charcoal on pale pink passes. Clear contrast first, then aesthetics.

CMYK does not convert cleanly

RGB to CMYK has no unique answer; presses, papers and inks all shift it. Saturated cyan, fluorescent green and bright orange on screen cannot be printed and will dull on conversion. The tool's CMYK values are approximations for discussion, not production data. Real jobs need ICC profiles and proofs. Converting press CMYK back to RGB also drifts, since screens cannot reproduce ink behaviour.

Practical pitfalls

Shorthand and long forms are equivalent, though some legacy code rejects three-digit HEX. Gradient midpoints are not arithmetic averages — HSL and RGB interpolation differ. Dark mode inverts the polarity, so contrast must be recomputed. Translucent colours composite with the backdrop, making rendered colour differ from the swatch. And brand spot colours need a Pantone reference; a CMYK approximation cannot stand in.

⏫︎