Three, six or eight hexadecimal digits, with or without the leading #.
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.
| Format | Typical use | Example for the same color |
|---|---|---|
| HEX | Stylesheets, design hand-off, short color codes | #3a7bd5 |
| RGB | Code that does arithmetic on channels, or image data | rgb(58, 123, 213) |
| RGBA | Transparent overlays, shadows, translucent backgrounds | rgba(58, 123, 213, 0.5) |
| HSL | Making tints and shades by changing lightness | hsl(215, 65%, 53%) |
| HSV | Colour pickers and design tools that work from brightness | hsv(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
No. Every conversion runs in your browser with plain JavaScript. Nothing you enter is transmitted or stored.
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.
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.
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.