Color Converter
Convert colours between hex, RGB and HSL. Type a hex code like #FF5733 to see its RGB values (255, 87, 51) and its HSL values (11°, 100%, 60%) — or enter RGB values to get the hex code back. The swatch shows the colour live as you type.
How to use this converter
Type a hex code (with or without #) to see its RGB and HSL values — or enter the red, green and blue values (0–255) to get the hex code. The swatch updates as you type.
Formula
Hex #FF5733 means red FF (255), green 57 (87), blue 33 (51) in base 16. RGB to hex: convert each 0–255 value to two hex digits. HSL: hue is the angle on the colour wheel (0° red, 120° green, 240° blue); saturation and lightness are percentages. #FF5733 is HSL(11°, 100%, 60%).
Hex is what websites use in CSS. RGB is what screens use (red, green and blue light). HSL (hue, saturation, lightness) is the easiest way for humans to think about colour: hue is the colour on the wheel, saturation is how vivid it is, lightness is how bright.
Example colours
| From | Equals |
|---|---|
| #FF5733 | RGB(255, 87, 51) · HSL(11°, 100%, 60%) |
| #000000 | RGB(0, 0, 0) · HSL(0°, 0%, 0%) |
| #FFFFFF | RGB(255, 255, 255) · HSL(0°, 0%, 100%) |
| #00FF00 | RGB(0, 255, 0) · HSL(120°, 100%, 50%) |
| #0000FF | RGB(0, 0, 255) · HSL(240°, 100%, 50%) |
Frequently asked questions
What is a hex colour code?
Six hexadecimal digits after a #: two for red, two for green, two for blue. #FF0000 is pure red, #00FF00 pure green, #0000FF pure blue, #FFFFFF white, #000000 black.
What is the difference between RGB and HSL?
RGB mixes red, green and blue light. HSL describes the same colour as hue (the colour), saturation (how vivid) and lightness (how bright). HSL is easier for picking colour schemes.
Can I use shorthand hex like #F53?
Yes — #F53 is shorthand for #FF5533. The converter accepts both.
Why do colours look different on different screens?
Screens vary in brightness, contrast and colour calibration, so the same code can look slightly different. For exact brand colours, check on the target device.