Advertisement

Color Converter — HEX, RGB and HSL

Convert three- or six-digit HEX, RGB and HSL colors, with HSV values and a clearly labeled algebraic CMYK approximation.

Convert a color between the common formats used in websites and digital artwork. Choose HEX, RGB or HSL as the input and read the equivalent 8-bit sRGB values. The tool also shows HSV saturation and value, plus a simple CMYK estimate for understanding the arithmetic.

How to use this tool

  1. Choose the input format; only its matching fields are used.
  2. Enter a three- or six-digit HEX code, integer RGB channels, or HSL values.
  3. Read the normalized HEX and RGB result before copying the other representations.

Formula

HSL: L = (max + min) / 2; S = (max − min) / (1 − |2L − 1|) when chroma is nonzero

The maximum and minimum are normalized RGB components. Hue identifies the channel sector. HSL input is first rounded to integer channels, with exact half-byte ties rounded upward, so all displayed formats describe the same resulting 8-bit color.

Example

HEX #336699 means RGB 51, 102, 153. Dividing by 255 gives 0.2, 0.4, 0.6. Lightness is 40%, HSL saturation is 50%, and hue is 210 degrees. HSV value is 60%.

Rounding

Digital channels are integers from 0 to 255. Small differences in a percentage input may round to the same output. Different monitors, profiles and surrounding colors can also make the same numeric color look different.

Frequently asked questions

Why is hue undefined for gray?

All three channels are equal, so there is no chromatic direction. The HSL text uses 0 degrees only as a conventional CSS placeholder.

Is the CMYK output ready for printing?

No. It uses K=1−max(R,G,B) and divides the remaining channel differences by 1−K. Real print conversion needs a device and paper profile; black is handled separately.

Can I enter transparency or a named color?

This tool accepts opaque HEX, RGB and HSL only. Four- and eight-digit alpha HEX, CSS keywords and wide-gamut color spaces are outside its input scope.

Sources

Last updated: 2026-10-30

Advertisement