Color Converter: HEX, RGB, HSL, HWB & CMYK

Convert one color into multiple formats instantly. Enter a HEX code, RGB, HSL, HWB, HSV, OKLCH, CMYK value or a named CSS color; preview the result and copy the format you need.

Try #2A6DF4, #26F, rgb(42, 109, 244), hsl(221, 90%, 56%), hwb(210 20% 10%), hsv(221, 83%, 96%), cmyk(83%, 55%, 0%, 4%), oklch(60% 0.2 260) or a name such as tomato. Supports #RGBA / #RRGGBBAA, rgba() and rgb(... / alpha). Press Esc to restore your last valid input.

Converted color values

See a live preview and copy each result. HEX, RGB, HSL, HWB and OKLCH can be used in CSS; HSV and CMYK are reference color models, not CSS color functions.

Transparency and background preview

An 8-digit HEX puts alpha last. The background changes the final visible color; the original RGB stays unchanged.

HEX8 uses 256 alpha levels; a typed 0.5 becomes 80 (128/255 ≈ 50.2%) when exported as HEX8.

White
Black
Export code (keep alpha)

How to convert a color

  1. Enter a HEX, RGB, HSL, HSV, OKLCH or CMYK value in the field above, or select an example.
  2. Compare the preview with the output values. All displayed values describe the resulting 8-bit sRGB color.
  3. Select Copy beside the format you want. If you need accessible text, check the exact foreground/background pair with a contrast checker.

HEX, RGB, HSL, HSV and CMYK: what is different?

HEX and RGB express the same sRGB channels for use on screens. HSL separates hue, saturation and lightness; HSV uses hue, saturation and value instead. HSV is useful in color controls but hsv() is not a CSS color function.

CMYK describes cyan, magenta, yellow and black components. This converter uses a simple mathematical approximation to and from sRGB; the result is not an ICC-profile-managed print separation or a print proof. For accurate printing, request a color-managed proof from your printer.

OKLCH organizes lightness, chroma and hue. Colors outside the sRGB gamut are mapped by reducing chroma, and the converter tells you when that happens.

HWB colors in CSS: hue, whiteness and blackness

hwb(210 20% 10%) uses a hue angle of 210°, 20% whiteness and 10% blackness. It corresponds to #338CE6 in 8-bit sRGB. Use space-separated values without commas; alpha values can be entered as HEX8 or rgb(42 109 244 / 50%).

When whiteness plus blackness reaches 100% or more, the color is gray and the hue has no visible effect. For example, hwb(45 40% 80%) becomes approximately #555555. You can copy the HWB result directly into a modern CSS property.

Worked color conversion example

#2A6DF4 corresponds to rgb(42, 109, 244). Try the sample, then compare the HSL, HSV and approximate CMYK values. Changing between models can introduce small rounding differences because the displayed HEX value uses 8-bit sRGB channels.

For more examples, browse the #2A6DF4 color profile, explore color palettes, or return to the color picker tool.

Conversions are calculated locally in your browser. Results for printed materials require color-profile verification.

Want to see how hues work together? Try the interactive Color Wheel to create a coordinated palette.

Check text readability with the WCAG color contrast checker before using a palette as an interface background.