Color Converter

HEX, RGB, HSL and HSV Color Converter

Three, six or eight hexadecimal digits, with or without the leading #.

HEX
RGB
RGBA
HSL
HSV

CSS custom property

Color Models in Plain Language

A color on a screen is a mix of red, green and blue light. RGB describes that mix directly, with each channel from 0 to 255. HEX writes the same three numbers in base 16, so 58 becomes 3a, 123 becomes 7b and 213 becomes d5. Both describe the same color, just in different notations.

HSL and HSV describe the color by how it looks to a person: its hue, which is a position around a color wheel from 0 to 360 degrees, and how strong and how light or bright it is. Designers often adjust hue and saturation in these models, then export the result as RGB or HEX for the web.

Where Each Format Is Used

Each notation suits a different job. The converter shows all of them at once so you can copy whichever one a tool expects.

FormatTypical useExample for the same color
HEXStylesheets, design hand-off, short color codes#3a7bd5
RGBCode that does arithmetic on channels, or image datargb(58, 123, 213)
RGBATransparent overlays, shadows, translucent backgroundsrgba(58, 123, 213, 0.5)
HSLMaking tints and shades by changing lightnesshsl(215, 65%, 53%)
HSVColour pickers and design tools that work from brightnesshsv(215, 73%, 84%)

Rounding and Accuracy

Channels are whole numbers from 0 to 255, while HSL and HSV values are shown rounded to whole degrees and percentages. Converting between the two families can therefore move a value by one step. The field you are typing in is never rewritten, so your input stays exactly as entered, and only the other readouts change.

The CSS line uses a six-digit HEX value when the color is opaque and an rgba() value when it has transparency. Use it inside a :root block or any selector, and check that the custom property name you chose does not clash with a variable already in your stylesheet.

Frequently Asked Questions

Is my color or anything I type sent to a server?

No. Every conversion runs in your browser with plain JavaScript. Nothing you enter is transmitted or stored.

Why does a color change slightly after I convert it to HSL and back?

Channel values are whole numbers from 0 to 255, while HSL and HSV values are rounded to whole degrees and percentages for display. A round trip can move a value by one step. The field you are typing in is never overwritten, so your input stays exactly as you typed it.

Is HSV the same as HSB?

Yes. HSV (hue, saturation, value) is also called HSB (hue, saturation, brightness). The two names describe the same model and use the same numbers, and this tool uses the HSV name.

Can I use the CSS line directly?

Yes. The line uses the custom property name you choose and a value written as a six-digit HEX code when the color is opaque, or as rgba() when it has transparency. Paste it inside a :root block or any selector.