HEX, RGB and HSL Explained Simply
What the three colour formats mean, how they relate, and which to use for which job.
2026-10-10 · 5 min read
Screens mix light
Every colour on a screen is a mix of red, green and blue light. RGB and HEX both describe that mix. HSL describes the same colour in a way that is closer to how people think.
How they map
- rgb(255, 87, 51) is the same as #FF5733.
- Convert each RGB number to two hexadecimal digits: 255 is FF, 87 is 57, 51 is 33.
- As HSL it is about 11 degrees of hue, full saturation and 60 percent lightness.
Common mistakes
- Forgetting the hash sign in a HEX value used in a stylesheet.
- Typing a value above 255 in RGB or above 100 percent for saturation or lightness.
- Assuming that the same colour looks identical on all screens.
- Mixing up hue degrees with percentages.
Which one to use
Use HEX for compact values in stylesheets and design files. Use RGB when you need transparency in rgba, or when working in code that expects numbers. Use HSL when you want to adjust a colour, such as making it lighter, darker or less intense, because you only change one value. Our colour tool converts between them so you can choose whichever suits the task.