HEX to RGB Color Converter
Type a hex colour code to get its RGB and HSL values, or paste an RGB value to get the hex code. Includes a colour picker and shorthand codes like #3b6.
#3fb56brgb(63, 181, 107)hsl(142, 48%, 48%)63, 181, 107How to use the HEX to RGB converter
- Type a hex code like #3fb56b, or pick a colour.
- Copy the RGB, HSL or plain values.
- To go the other way, type an RGB value like rgb(63, 181, 107) on the right to get its hex code.
How HEX and RGB relate
A hex colour is three pairs of hexadecimal digits for red, green and blue, each from 00 to ff (0 to 255). #3fb56b is red 63, green 181, blue 107. Short codes double each digit: #3b6 is #33bb66. An 8-digit code adds transparency: #3fb56b80 is about 50% opaque.
Questions
Does it support transparency?
Yes. An 8-digit hex code (or 4-digit shorthand) becomes rgba() with the alpha value, and rgba() with an alpha below 1 becomes an 8-digit hex code.
Can I paste values without rgb()?
Yes. 63, 181, 107 or 63 181 107 work too, and so do percentages like rgb(25%, 71%, 42%).
What is HSL?
Hue (0–360°), saturation and lightness (0–100%). It's handy in CSS when you want a lighter or darker version of the same colour.