Color Converter

Convert HEX, RGB, HSL, HSV, HWB and CMYK, and check contrast. A single HEX to RGB stays on HEX to RGB

Pick a color

HEX
RGB
HSL
HSV
HWB
CMYK

What this page does

The same color can be written as HEX, RGB, HSL or HSV. This page keeps those formats in step, includes a color picker, and checks contrast against a second HEX color. A one-way HEX to RGB stays on HEX to RGB.

How to use

  1. Pick a color, or type HEX, RGB, HSL, HSV, HWB or CMYK. The other fields, the CSS strings and the swatch update as you type. There is no Convert button. Copy copies that row.
  2. HEX also accepts rgb(), hsl(), hwb() and cmyk(). #RGB expands by doubling each digit.
  3. Compare with is the second HEX color used for contrast.
  4. Show Example sets Compare with to #e8f0f6 and HEX to #112233. RGB is rgb(17, 34, 51). HSL is hsl(210, 50%, 13.3%). HSV is hsv(210, 66.7%, 20%). HWB is hwb(210, 6.7%, 80%). CMYK is cmyk(66.7%, 33.3%, 0%, 80%). The ratio is 14.02:1. Normal text AA, AAA and large text AA all pass.
  5. Clear All empties every field, the swatch and the ratio.

Rules and edges

#RGB expands by doubling each digit, so #123 is #112233. Incomplete HEX is ignored until it is 3, 4, 6 or 8 hex digits. RGB empty fields do not convert until R, G and B are all filled. Values outside range are clamped: H 0–360, S, L, V, W, C, M, Y and K 0–100, R, G and B 0–255. HSV is the same model as HSB. CMYK is the common device formula, not a printer ICC profile. Contrast uses the WCAG relative luminance. AA for normal text is 4.5:1, AAA is 7:1, and AA for large text is 3:1. An empty Compare with field hides the ratio.

Where to use it

  • Turning a dark HEX color into HSL or HSV.
  • Checking a dark blue on a light background.
  • Copying rgb(17, 34, 51) into CSS.

Questions

Does this page convert HWB or CMYK?

Yes. HWB follows CSS Color 4. CMYK uses the common device formula from RGB, not a printer ICC profile.

Why do all three grades pass?

14.02:1 is above 7, so normal text AA, AAA and large text AA all pass for #112233 on #e8f0f6.