Skip to main content

Color Converter

Convert colors (Hex, RGB, HSL)

Input Color

Maximum 128 characters.

#3b82f6
Converted Formats
hex
rgb
hsl
hwb
cmyk
xyz
lab
name

Was this Color Converter helpful?

Help us keep tools reliable, fast, and bug-free.

What you can do with Color Converter

  • Convert hex to rgb
  • Change rgb to hsl

How this color and design utility works

Convert a color value into hexadecimal, RGB, HSL, HWB, CMYK, XYZ, LAB, and a matching CSS color name when available.

Example input

rgba(255, 0, 0, 0.5)

Example output

HEX: #ff000080 | RGB: rgba(255, 0, 0, 0.5) | HSL: hsla(0, 100%, 50%, 0.5) | HWB: hwb(0 0% 0% / 0.5) | CMYK: device-cmyk(0% 100% 100% 0% / 0.5) | XYZ: xyz(43.61, 22.25, 1.39) | LAB: lab(54.29% 80.81 69.89) | NAME: Unknown

Practical workflow

  1. Enter a supported hexadecimal, RGB, HSL, or CSS named color, or open the visual color picker.
  2. Inspect the live HEX, RGB, HSL, HWB, CMYK, XYZ, LAB, and CSS name values.
  3. For a color with alpha, use an alpha hexadecimal or RGBA value and review the alpha-capable outputs.
  4. Copy the value from the output format you need.

Common use cases

  • Translating design tokens from Figma into CSS variables.
  • Comparing the same color across common CSS formats when moving a design value into code.
  • Converting a translucent hexadecimal or RGBA color and checking which formats retain its alpha channel.
  • Finding the closest supported CSS name for standard named colors.

Important notes and limitations

  • Accepts common HEX, RGB, HSL, and CSS named colors, including 3-, 4-, 6-, and 8-digit hexadecimal values.
  • The text input accepts up to 128 characters; longer saved values are rejected before color parsing.
  • Alpha is retained by HEX, RGB, HSL, HWB, and CMYK output; XYZ, LAB, and CSS color names do not represent alpha.
  • The visual picker changes an opaque color. The tool does not provide an alpha slider, HSV/CMYK input, or color palette generation.

CLI color space conversion (HEX, RGB, HSL, OKLCH)

Convert HEX to RGB with ImageMagick

convert xc:'#3b82f6' -format '%[pixel:p{0,0}]' info:

Resolves hex code to standard rgb() and sRGB channel percentage values.

Gamut clipping & CSS Color 4 browser support

Color clipping when converting wide-gamut Display P3 to sRGB

Cause: Vibrant colors defined in modern OKLCH or Display P3 exceed standard sRGB gamut boundaries.

Solution: Use CSS Color Module 4 'color(display-p3 ...)' or clamp values using gamut mapping algorithms.

Continue your workflow

Frequently asked questions

How does 8-digit Hex (Hex8) notation represent opacity?

The final two digits in an 8-character hex code represent alpha transparency from 00 (0% opacity) to FF (100% opacity). For example, #7c3aed80 represents ~50% transparency.

Why do RGB screen colors sometimes look different when converted to CMYK for print?

RGB is an additive light model with a wide gamut used by digital monitors, whereas CMYK is a subtractive ink model with a narrower physical print gamut.

How does the converter preserve a color's alpha channel?

Four- and eight-digit hexadecimal or alpha-bearing CSS input can retain alpha in HEX, RGB, HSL, HWB, and CMYK output. XYZ, LAB, and named colors do not include alpha.

Focused guides for this tool