Color Converter

Convert colors between HEX, RGB, HSL, and HSV formats. See a live preview of any color you enter.

HEX
#6366f1
RGB
rgb(99, 102, 241)
HSL
hsl(239, 84%, 67%)
HSV
hsv(239, 59%, 95%)

What Are Color Models?

Colors can be represented in multiple ways, and different color models serve different purposes. HEX is the most common format for web design, using a six-digit hexadecimal code to represent colors. RGB (Red, Green, Blue) specifies colors as intensities of three primary colors of light, each ranging from 0 to 255. HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value) describe colors in a way that is more intuitive for humans, separating the hue (the pure color) from its saturation and brightness characteristics.

Each format has its strengths. HEX is compact and widely used in CSS. RGB is more explicit and supported in every graphics library. HSL makes it easy to create color variations by adjusting lightness or saturation while keeping the same hue. HSV is similar to HSL but better represents how colors appear on computer screens.

How to Use This Tool

Select the input color format from the dropdown, then enter a valid color value in the text field. As you type, the color preview updates in real time, and the converted values for all four formats appear below. If you enter an invalid color, the tool shows an error message. Use the color preview to verify that the color looks as expected.

Valid input examples: HEX (#ff0000 or #f00), RGB (rgb(255, 0, 0) or 255,0,0), HSL (hsl(0, 100%, 50%) or 0,100%,50%), HSV (hsv(0, 100%, 100%) or 0,100%,100%).

When to Use Each Color Format

Understanding Color Conversion

Converting between color formats involves mathematical formulas. HEX to RGB converts pairs of hexadecimal digits (like ff) to decimal values (255). RGB to HSL and HSV involve more complex calculations that first determine which of the RGB components is dominant, then compute hue based on the ratios between components. These conversions are lossless and deterministic: converting a color from any format to another and back should always produce the original value, within rounding precision.