Convert a three- or six-digit HEX color or integer RGB color into HEX, RGB and HSL representations. The result describes an sRGB color, not print color management.
Explicit formulas and worked examples
Check your inputs, then calculate
Data is calculated in this browser only
Check the stated input format, calculation convention and limits before using the result.
Check the example inputs, then calculate. Your values stay in this browser.
Input supports #RGB, #RRGGBB and rgb(r,g,b); HSL input and alpha are not yet supported.
Calculation notes
Understand the Color Code Converter
Color Code Converter validates hex or rgb color before applying the displayed equation. Input supports #RGB, #RRGGBB and rgb(r,g,b); HSL input and alpha are not yet supported.
Formula and logic
What is the formula for the Color Code Converter?
Color Code Converter: hex = base16(R,G,B); HSL = hue, saturation and lightness from normalized RGB. Input definitions: value = HEX or RGB color. Use the selected convention throughout the calculation.
Worked example
How can I reproduce the Color Code Converter example?
Color Code Converter baseline input: HEX or RGB color: #0080FF. Output: HEX = #0080FF; RGB = rgb(0, 128, 255); HSL = hsl(209.88, 100.00%, 50.00%). Substitute these values into the displayed equation to reproduce the result.
How to read the result
How should I interpret the Color Code Converter result?
Read hex with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
Change one input at a time and use the equation to explain the result; do not mix unit, grade-scale, time-zone or rounding conventions across comparisons.
Limits and assumptions
What limits apply to the Color Code Converter?
Input supports #RGB, #RRGGBB and rgb(r,g,b); HSL input and alpha are not yet supported.
Color spaces, display calibration and CMYK are outside this tool.
Convert a three- or six-digit HEX color or integer RGB color into HEX, RGB and HSL representations. The result describes an sRGB color, not print color management.
Enter HEX or RGB color in the stated format. Baseline values are for reproduction.
Check the output unit and convention: Read hex with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
Change one input and compare the result. Input supports #RGB, #RRGGBB and rgb(r,g,b); HSL input and alpha are not yet supported. Color spaces, display calibration and CMYK are outside this tool.
Color Code Converter: calculation relationships
Hex pairs encode RGB channel integers from 0 to 255. #FF8000 becomes rgb(255,128,0); short #f80 instead expands to #FF8800, not #FF8000. HSL describes hue, saturation and lightness for the same channels, with hue undefined for a neutral gray and shown as zero by convention. Alpha and color-profile conversion are outside this parser.
hex = base16(R,G,B); HSL = hue, saturation and lightness from normalized RGB
The detailed guide adds variable definitions, a reproducible example, a practice question and model limitations.