Color Picker & Hex/RGB Converter
Web colours are written three ways — Hex for stylesheets, RGB for code, and HSL when you need to reason about lightness — and converting between them by hand is error-prone. Pick a colour with the visual picker or type a hex value, and all three formats update together, with a large preview swatch.
| Hex | #2563EB |
| RGB | rgb(37, 99, 235) |
| HSL | hsl(221, 83%, 53%) |
| CSS variable style | --color: #2563EB; |
How to use
- Use the colour well to pick a colour visually, or type a hex code into the text field.
- Read the matching RGB and HSL values in the table.
- Click any value row’s text to select it for copying, or simply copy it by hand.
Frequently asked questions
What is the difference between RGB and HSL?
RGB mixes red, green and blue light directly. HSL describes a colour by hue (the colour itself), saturation (how vivid it is) and lightness, which makes it easier to create lighter or darker variants of a brand colour.
Why do hex codes have six digits?
Each pair of hex digits is one channel — red, green, blue — with values from 00 to FF (0 to 255). Three-digit shorthand such as #fff expands to #ffffff.
What is a “web safe” colour?
A legacy term for the 216 colours old displays could all show reliably. Modern screens show millions of colours, so any hex value is safe to use today.