Huebook

Color code converter

HEX, RGB, HSL and CMYK in short

HEX writes a color as three pairs of hexadecimal digits for red, green and blue, from 00 to FF. It is the usual format in CSS and design tools. RGB gives the same three channels as numbers from 0 to 255.

HSL describes the color the way people think about it: hue (an angle on the color wheel), saturation (how vivid) and lightness (how close to black or white). It is handy for making lighter or darker versions of a color.

Converting by hand

To turn HEX into RGB, read each pair as a base-16 number: 3D is 3 × 16 + 13 = 61. For HSL, scale R, G and B to 0–1; lightness is the average of the largest and smallest channel, and saturation and hue follow from how far apart the channels are.

CMYK is used for print: the share of cyan, magenta, yellow and black ink. The values here are a simple conversion without a printer profile, so check them against your printer's proof for exact results.