Hex to Color Converter
Convert hexadecimal color codes to RGB, HSL, CMYK, and more formats instantly
Color Preview
#1F9BD4
Text Preview
See how text looks on this color
Popular Hex Color Codes
Red
Lime
Blue
Yellow
Magenta
Cyan
Black
White
Gray
Orange
Purple
Pink
Conversion Examples
RGB: rgb(255, 0, 0)
HSL: hsl(0, 100%, 50%)
CMYK: cmyk(0%, 100%, 100%, 0%)
RGB: rgb(0, 0, 255)
HSL: hsl(240, 100%, 50%)
CMYK: cmyk(100%, 100%, 0%, 0%)
RGB: rgb(0, 255, 0)
HSL: hsl(120, 100%, 50%)
CMYK: cmyk(100%, 0%, 100%, 0%)
Common Hex Color Reference Table
| Color | Name | Hex Code | RGB | HSL |
|---|---|---|---|---|
| Red | #FF0000 | 255, 0, 0 | 0°, 100%, 50% | |
| Lime | #00FF00 | 0, 255, 0 | 120°, 100%, 50% | |
| Blue | #0000FF | 0, 0, 255 | 240°, 100%, 50% | |
| Yellow | #FFFF00 | 255, 255, 0 | 60°, 100%, 50% | |
| Cyan | #00FFFF | 0, 255, 255 | 180°, 100%, 50% | |
| Magenta | #FF00FF | 255, 0, 255 | 300°, 100%, 50% | |
| Silver | #C0C0C0 | 192, 192, 192 | 0°, 0%, 75% | |
| Gray | #808080 | 128, 128, 128 | 0°, 0%, 50% | |
| Maroon | #800000 | 128, 0, 0 | 0°, 100%, 25% | |
| Olive | #808000 | 128, 128, 0 | 60°, 100%, 25% | |
| Green | #008000 | 0, 128, 0 | 120°, 100%, 25% | |
| Purple | #800080 | 128, 0, 128 | 300°, 100%, 25% | |
| Teal | #008080 | 0, 128, 128 | 180°, 100%, 25% | |
| Navy | #000080 | 0, 0, 128 | 240°, 100%, 25% | |
| Orange | #FFA500 | 255, 165, 0 | 39°, 100%, 50% | |
| Pink | #FFC0CB | 255, 192, 203 | 350°, 100%, 88% |
What is a Hex Color Code?
A hexadecimal color code is a six-digit representation of colors used in web design and development. Each hex code begins with a hash symbol (#) followed by six characters that define the intensity of red, green, and blue (RGB) components.
How Hex Codes Work
Hex codes consist of three pairs of characters, each representing one color channel:
- #RRGGBB – RR (red), GG (green), BB (blue)
- Each pair ranges from 00 (minimum intensity) to FF (maximum intensity)
- For example, #FF0000 means maximum red (FF), no green (00), no blue (00)
- 16,777,216 possible color combinations exist in the hex system
Short Hex Notation
When both characters in each pair are identical, you can use shorthand notation. For instance, #FFFFFF can be written as #FFF, and #000000 as #000. This three-character format expands to six characters automatically.
Color Format Conversion Methods
Hex to RGB Conversion
Converting hex to RGB involves separating the hex code into three pairs and converting each from hexadecimal (base 16) to decimal (base 10):
Step 2: Separate into pairs: 1F, 9B, D4
Step 3: Convert to decimal: 1F=31, 9B=155, D4=212
Result: rgb(31, 155, 212)
Hex to HSL Conversion
HSL (Hue, Saturation, Lightness) conversion requires first converting to RGB, then calculating each HSL component:
Step 2: Normalize RGB values to 0-1 range
Step 3: Calculate hue based on max/min RGB values
Step 4: Calculate saturation and lightness
Result: hsl(199°, 75%, 48%)
Hex to CMYK Conversion
CMYK (Cyan, Magenta, Yellow, Key/Black) is used primarily in printing. Conversion requires RGB intermediary values:
Step 2: Normalize RGB to 0-1 range
Step 3: Calculate K (black) = 1 – max(R,G,B)
Step 4: Calculate C, M, Y using K value
Result: cmyk(85%, 27%, 0%, 17%)
Frequently Asked Questions
Popular Color Scheme Combinations
These hex code combinations create harmonious color palettes for web design, branding, and creative projects:
