Each channel occupies two hexadecimal digits
A six-digit value is read as red, green, and blue pairs from 00 through FF. Three-digit shorthand duplicates each digit, so #C90 expands to #CC9900.
Convert HEX color codes to RGB, RGBA, HSL, and HSLA values with visual color preview and copy options.
HEX, RGB, and HSL are different notations for the same sRGB color. This converter accepts 3, 4, 6, or 8 hexadecimal digits, expands shorthand, and calculates copyable RGB, RGBA, HSL, and HSLA values. Eight-digit input keeps the final alpha channel instead of discarding transparency.
A concrete input and expected output from the current implementation.
Input
#C49000
Expected output
rgb(196, 144, 0) hsl(44, 100%, 38%)
C4, 90, and 00 are hexadecimal channel values. Converted to decimal they become red 196, green 144, and blue 0.
A six-digit value is read as red, green, and blue pairs from 00 through FF. Three-digit shorthand duplicates each digit, so #C90 expands to #CC9900.
The largest and smallest RGB channels determine lightness and saturation, while their relative positions determine hue. Displayed HSL values are rounded to whole units.
The first six digits contain RGB and the final two contain alpha. For example, FF is fully opaque and 00 is fully transparent.
CSS defines #RGB as an abbreviation where each digit is repeated. Expanding it makes the exact channel values visible.
The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.
Pick colors visually and convert between HEX, RGB, HSL, and CMYK formats.
Preview how screen colors translate to print with CMYK simulation and proofing.
Preview any Google Font at various sizes, weights, and with custom sample text.
Create linear, radial, and conic CSS gradients with a visual editor and code output.
Generate harmonious color palettes from a base color using color theory rules.
Simulate how colors appear to people with various types of color vision deficiency.