Hex to RGB & HSL Color Converter
Convert color codes between Hex, RGB, HSL, and CSS color representations with interactive live color preview.
Color Input
Converted Formats
About the Hex to RGB & HSL Color Converter
Web design and software engineering require working with diverse color formats—from 6-digit Hex codes in CSS stylesheets to RGB integer channels in canvas manipulation and HSL degrees for dynamic UI theming.
Our Hex to RGB Converter translates any color input into clean, copy-paste-ready Hex, RGB, RGBA, HSL, and CMYK color strings.
How the Calculations Work
Hexadecimal pairs (00-FF) translate into 8-bit integers (0-255) for Red, Green, and Blue channels.
R = Hex(1,2), G = Hex(3,4), B = Hex(5,6)
Variables & Definitions
- Hex: #RRGGBB base-16 string
- RGB: rgb(r, g, b) base-10 integers 0-255
#059669 converts to Red = 5, Green = 150, Blue = 105 -> rgb(5, 150, 105).
Key Terms Explained
Hex Color
A six-digit hexadecimal representation of RGB values preceded by a pound sign.
HSL
Hue (degrees on the color wheel), Saturation (%), and Lightness (%).
Practical Tips & Pitfalls to Avoid
Use CSS variables
Store RGB channel integers as variables to easily declare semi-transparent colors via rgba(var(--rgb), 0.5).
Frequently Asked Questions
Take each 2-digit hex pair and convert from base 16 to decimal: (First digit * 16) + Second digit.