Colour Code Converter
Enter a colour in HEX, RGB, HSL or HSV and get the same colour in all the other notations.
- HEX
- #1e90ff
- RGB
- rgb(30, 144, 255)
- HSL
- hsl(209.6, 100%, 55.9%)
- HSV / HSB
- hsv(209.6, 88.2%, 100%)
Red 30, green 144, blue 255. Hue 209.6°, HSL saturation 100% and lightness 55.9%, HSV saturation 88.2% and value 100%.
About Colour Code Converter
Screens mix red, green and blue light, and there are several ways to write down the same mix. HEX packs the three channels into six hexadecimal digits, as in #1e90ff. RGB lists them as numbers from 0 to 255. HSL describes a colour by hue (an angle on the colour wheel), saturation and lightness, which is easier to adjust by hand. HSV, also called HSB, uses hue, saturation and value (brightness) and is common in design software colour pickers. Colour Code Converter reads any of these and writes the colour in all of the others at once, with a preview swatch.
When to use it
- A brand guide gives you a HEX code but your design tool or CSS wants HSL.
- You copied an RGB value from an image editor and need the HEX code for a website.
- You want a lighter or darker shade: convert to HSL, change the lightness, and convert back.
Worked example
Type #1E90FF. The tool shows rgb(30, 144, 255), hsl(209.6, 100%, 55.9%) and hsv(209.6, 88.2%, 100%). Now type hsl(145, 63%, 42%): the colour is rounded to whole RGB values, giving rgb(40, 175, 96) and #28af60, and the HSL line becomes hsl(144.9, 62.8%, 42.2%). That small change is expected, because every notation is calculated from the same 8-bit RGB colour, so all four always describe exactly the same pixel colour. Add transparency with an eight-digit code such as #1e90ff80 and the results become rgba(30, 144, 255, 0.502) and hsla(209.6, 100%, 55.9%, 0.502).
Good to know
- Accepted input: 3, 4, 6 or 8-digit HEX (with or without
#),rgb(),rgba(),hsl(),hsla(),hsv()andhsb(), with commas or spaces, and the slash form for opacity. - Hue can be written in degrees,
turn,radorgrad. - Values outside the range, such as
rgb(300, 0, 0), are clamped. - Colour names like
redare not accepted yet. - For number systems beyond hexadecimal, try the Number Base Converter.
How to use Colour Code Converter
- Type or paste a colour code, or pick a colour.
- Check the preview swatch.
- Copy the notation you need.
Privacy: how it works
Conversions run in your browser. Nothing you type is sent anywhere.
Frequently asked questions
Why do HSL values sometimes have decimals?
Colours are stored as whole RGB values from 0 to 255, so an exact hue or lightness is often a fraction. Values are rounded to one decimal place.
Is transparency supported?
Yes. Eight-digit HEX codes, rgba(), hsla() and the slash form such as rgb(255 0 0 / 50%) keep their opacity.
Are colour names such as "red" accepted?
Not yet. Enter a HEX, RGB, HSL or HSV value instead.