Color Converter

Preview an opaque color and copy HEX, RGB or HSL with a color picker and selected output formats.

Text is processed locally in your browser and is not uploaded.

Page guide

How to use this tool

  1. Enter the source in the input field.
  2. Enter supported opaque color notation or use the color picker. Choose all representations or HEX, RGB or HSL alone.
  3. Valid input updates after a brief typing pause. You can also use the main action button. Resolve errors before copying or downloading.
  4. Clear input keeps the conversion settings; Undo input change restores the previous inputs after clear or reverse. Reset restores the example and default settings.

Understanding the output

HEX and RGB describe red, green, and blue channels. HSL describes hue, saturation, and lightness within the same sRGB model. HSL input is converted to integer RGB channels, and the displayed HSL output is recalculated from those rounded channels.

Three ways to describe red

#f00 expands to #ff0000, rgb(255, 0, 0), and hsl(0, 100%, 50%). These represent the same opaque sRGB color. For #f00, RGB-only output is rgb(255, 0, 0), and HSL-only output is hsl(0, 100%, 50%).

Choose notation for the editing task

HEX is compact and common in design specifications. RGB makes channel values explicit. HSL can be convenient when adjusting hue or making a rough change in saturation and lightness. These are different descriptions of an sRGB color, not conversions between display color spaces such as Display P3 or a print profile.

The preview helps catch a mistyped channel or an unexpected hue, but the screen and viewing conditions affect appearance. For print work or color-critical production, use a managed workflow and the correct destination profile.

Rounding and accessibility are separate concerns

Converting an arbitrary HSL value to eight-bit RGB requires rounding, so converting back may not reproduce every original decimal exactly. The tool reports HSL to two decimal places for readability. It does not calculate text contrast or certify that a foreground/background combination meets an accessibility standard; that requires checking the pair of colors together.

Method and supported input

HEX values are expanded into integer RGB channels. HSL conversion uses the standard chroma, secondary component, and lightness offset relationships. Output uses opaque eight-bit sRGB channels.

Selecting a single format changes copied and downloaded text while keeping the same opaque sRGB swatch. The picker supplies six-digit HEX; it does not add alpha support.

  • The color is opaque and belongs to the sRGB model.

Limitations

  • Alpha, named colors, modern space-separated syntax, and other color spaces are not supported.
  • The swatch is not a contrast checker or a calibrated color proof.

Common questions

Why did my HSL decimals change after conversion?

HSL input is rounded to integer RGB channels before the output HSL is recalculated, so small differences are expected.

Can I use an eight-digit HEX color?

No. Eight-digit HEX includes alpha. This utility currently accepts only opaque three- and six-digit HEX values.

Sources and further reading

Reviewed on