This color converter translates color codes between HEX, RGB (Red, Green, Blue), and HSL (Hue, Saturation, Lightness) formats. Enter a value in any format to see the equivalents in the other formats and view a live color preview.
Formula Used
HEX ↔ RGB ↔ HSL conversion formulas
HEX
— a six-digit hexadecimal representation of colors (e.g. #3498db)
RGB
— color defined by Red, Green, and Blue intensities from 0 to 255
HSL
— color defined by Hue (0-360°), Saturation (0-100%), and Lightness (0-100%)
Example Calculation
If you enter the HEX value '#3498db', the converter translates it: RGB = (52, 152, 219); HSL = (204°, 70%, 53%). It also displays a blue preview block.
Frequently Asked Questions
HEX is a hexadecimal code used in web design to represent colors. It consists of a '#' followed by three bytes representing Red, Green, and Blue intensities in base-16 (from 00 to FF).
HSL stands for Hue, Saturation, and Lightness. Hue is the color type represented as an angle on the color wheel (0-360°). Saturation is the intensity or purity (0-100%). Lightness is the brightness (0-100%).
All three formats are supported in modern CSS. HEX is popular for static colors. HSL is often preferred by designers because it is easier to adjust brightness or saturation dynamically using variables.
RGB is an additive color model where red, green, and blue light are added together in various proportions to produce a broad array of colors. It is the standard format for digital displays.
Floating-point rounding when converting between base-256 RGB values and base-100 HSL percentages can cause minor rounding differences, but they are visually identical.