Instantly convert a hex color code to RGB and HSL, with a live color preview.
Hex color codes are the most common color representation in web design: a 6-digit code starting with # (e.g. #6366F1) that expresses the red, green, and blue components as two-digit hexadecimal numbers. RGB (Red, Green, Blue) represents the same information as three decimal numbers ranging from 0 to 255. HSL (Hue, Saturation, Lightness) expresses color as a hue angle (0-360 degrees), saturation percentage (0-100%), and lightness percentage (0-100%), making it more intuitive for designers to adjust. Short 3-digit hex codes (e.g. #fff) are expanded to a 6-digit code by repeating each digit (#fff becomes #ffffff).
Common questions about color conversion
They both express the same color in different ways. Hex packs the color into a single 6-digit hexadecimal code (#6366F1), while RGB shows the red, green, and blue components separately as decimal numbers from 0 to 255 (rgb(99, 102, 241)). They represent the same color, just in different notations.