iHow it is calculated
A HEX code #RRGGBB splits into three pairs, each converted to the matching RGB value (0–255):
The code #3B82F6 means rgb(59, 130, 246), that is hsl(217°, 91%, 60%) — a vivid blue.
Convert colours between HEX, RGB and HSL, both ways, with an instant preview. Ideal for web, design and CSS.
Enter the colour
Enter a HEX code (e.g. #3B82F6) or adjust the R, G, B channels. See the RGB and HSL equivalents.
Edit the HEX code or the RGB channels — the conversion runs both ways automatically. HSL is handy for tweaking hue and lightness.
#3B82F6 · rgb(59, 130, 246) · hsl(217, 91%, 60%)Handy everyday tools. Simple, fast calculations for common situations. Everything runs instantly in your browser, no account, no data sent.
A HEX code #RRGGBB splits into three pairs, each converted to the matching RGB value (0–255):
The code #3B82F6 means rgb(59, 130, 246), that is hsl(217°, 91%, 60%) — a vivid blue.
Split the code into three pairs of two hexadecimal digits and convert each pair to decimal (0–255). For example, #3B82F6 means R=59, G=130, B=246.
Convert each channel (0–255) to two hexadecimal digits and join them in R, G, B order with a # in front. For example, rgb(59, 130, 246) becomes #3B82F6.
It is the #RRGGBB notation used in HTML and CSS, where each pair of hexadecimal digits represents the intensity of red, green and blue, from 00 to FF (0–255).
RGB stands for the three colour channels — Red, Green and Blue — each with values from 0 to 255. Combined, they form any colour on screen.
HSL stands for Hue (0–360°), Saturation (0–100%) and Lightness (0–100%). It is a more intuitive way to adjust a colour than RGB.
You can enter the known HEX code or adjust the RGB channels until you get the shade you want. The preview shows the colour instantly, and the HEX, RGB and HSL values update.
#FFFFFF is white (all channels at maximum, 255) and #000000 is black (all at 0). #FF0000 is pure red, #00FF00 pure green and #0000FF pure blue.
With 8 bits per channel (256 values), you can form 256 × 256 × 256 = 16,777,216 colours, that is about 16.7 million, enough for any ordinary screen.