Convert hex color codes to RGB and HSL instantly. Live preview swatch. Reverse conversion: RGB back to hex. Supports 3 and 6 digit hex.
A hex color code is a 6-digit (or 3-digit shorthand) hexadecimal representation of a color used in HTML and CSS. For example, #ff5733 represents a red-orange color. The first two digits are the red channel, the next two green, and the last two blue โ each ranging from 00 (0) to ff (255).
Split the 6-digit hex into three pairs and convert each from base-16 to decimal. #ff5733 splits into ff=255, 57=87, 33=51, giving rgb(255, 87, 51). This tool does that instantly with a live preview.
HSL stands for Hue, Saturation, Lightness. Hue is a degree on the color wheel (0โ360), saturation is a percentage (0% = grey, 100% = full color), and lightness is a percentage (0% = black, 100% = white). Many designers find HSL more intuitive than RGB for making colors lighter, darker or less saturated.
A 3-digit hex like #f53 is shorthand for #ff5533 โ each digit is simply doubled. This tool handles both formats automatically.