Color Converter (HEX, RGB, HSL)
Convert colors between HEX, RGB and HSL, including alpha. Paste any one format and get all the others, with a color preview.
Convert colors between HEX, RGB and HSL, including alpha. Paste any one format and get all the others, with a color preview.
CSS accepts colors in several notations. Designers often work in HEX while developers need RGB or HSL for calculations.
Paste a color in any of these formats and get the others instantly, with a swatch so you can check it.
#ff8800 = rgb(255, 136, 0) = hsl(32, 100%, 50%)
HEX, RGB and HSL describe the same sRGB colors in different ways. HEX is base-16 shorthand for red, green and blue channels, each from 0 to 255, so ff8800 means 255, 136 and 0. HSL re-expresses that as hue in degrees around the color wheel, saturation as a percentage, and lightness as a percentage. Converting from RGB to HSL involves finding the largest and smallest channel, taking their average for lightness, and deriving hue from which channel dominates.
Short HEX forms double each digit, so #f80 expands to #ff8800, and the eight-digit form appends two digits for alpha, where 80 is roughly 50 percent opacity. Because HSL is rounded to whole numbers here, converting an HSL value back to RGB can differ by one step in a channel. That is harmless visually, but if you need exact brand values, store the HEX or RGB original. HSL is convenient for building tints and shades by changing only lightness.
HEX such as #f80, #ff8800 or #ff880080, rgb() or rgba(), and hsl() or hsla().
HEX and RGB are exact. HSL values are rounded to whole numbers.
When the color has transparency, rgba() and hsla() lines are added to the output.
No. It runs in your browser.
Alpha is a hex byte from 00 to ff. The value 80 is 128 out of 255, so about 50 percent opacity, and ff is fully opaque.
No. It handles HEX, rgb() and hsl() notation as listed. Named colors, HSB, CMYK and newer CSS spaces such as lab or oklch are not converted.