Skip to content

Color Converter

Convert between HEX, RGB, and HSL, preview transparency, and copy a value for your CSS.

Input color

Select a format and enter a value, or use the picker for an opaque color. Enter a value with alpha to set transparency.

Converted values

Enter a CSS color

  • HEX accepts 3, 4, 6, or 8 digits, such as #38F or #3B82F680. In a 4-digit value, the last digit is alpha. In an 8-digit value, the last two digits are alpha.
  • RGB accepts CSS functions such as rgb(59 130 246 / 50%) or rgba(59, 130, 246, 0.5).
  • HSL accepts CSS functions such as hsl(217 91% 60% / 50%) or hsla(217, 91%, 60%, 0.5).

HEX output rounds each color channel and alpha to an 8-bit value. RGB and HSL can represent fractional values. W3C CSS Color Module Level 4