Type a hex code to preview the color & get RGB values
Pick a color visually to get its hex code
What is a hex color code?
A hex color code is a 6-digit hexadecimal number prefixed with # that represents an RGB color. The first two digits are the red channel (00–FF), the next two are green, and the last two are blue. For example, #FF0000 is pure red.
How do I convert a hex color to RGB?
Split the hex code into three pairs and convert each pair from hex to decimal. For #1A3F6F: red = 1A = 26, green = 3F = 63, blue = 6F = 111. Result: rgb(26, 63, 111). This tool does it automatically.
What is HSL?
HSL stands for Hue, Saturation, Lightness — an alternative way to describe colors. Hue is the color angle (0–360°), saturation is how vivid the color is (0–100%), and lightness is how light or dark it is (0–100%). HSL is often more intuitive than RGB when you want to adjust how bright or saturated a color is.
What is the difference between a 3-digit and 6-digit hex color?
A 3-digit hex code like #F05 is shorthand for a 6-digit code where each digit is doubled: #FF0055. This shorthand only works when both digits in each pair are identical. 6-digit codes can represent any of the 16.7 million possible RGB colors; 3-digit codes only represent 4,096 of them.