How to Pick and Convert Colors
Use the color picker to visually choose a color, or enter a specific value in HEX, RGB, or HSL format.
The tool shows your color in HEX, RGB, and HSL simultaneously.
Click Copy next to any format to use it in your CSS or design tool.
One colour, four ways to write it
The same colour in each notation
| Notation | Example | How to read it |
|---|---|---|
| HEX | #6c63ff | Three pairs of hex digits for red, green and blue, each from 00 to ff |
| RGB | rgb(108, 99, 255) | The same three values as numbers from 0 to 255 |
| HSL | hsl(243, 100%, 69%) | Hue as an angle on the colour wheel, then saturation and lightness |
| CSS variable | --color: #6c63ff; | A named value you define once and reuse in a style sheet |
- HEX and RGB are the same information.
6cin hex is 108,63is 99,ffis 255. Use whichever your program asks for. - Short HEX codes are accepted.
#f60means#ff6600— each digit is doubled. - HSL is the one to use when you want to adjust a colour. Keep the hue and lower the lightness for a darker shade of the same colour; lower the saturation for a greyer one. Doing the same in HEX means changing all three pairs at once.
- Hue angles to remember: 0° red, 60° yellow, 120° green, 180° cyan, 240° blue, 300° magenta. Adding 180° gives the complementary colour.
Picking a colour from the screen
- Pick from Screen turns the pointer into a magnifier; click any pixel in any window to read its colour. The button appears in Chrome, Edge and Opera on a computer. Firefox and Safari do not offer this feature to websites yet, so the button is hidden there.
- Colours from photos vary pixel by pixel. Zoom in and pick from a flat area, or pick several pixels and take a middle value.
Readable text
- Check contrast, not just taste. The accessibility guideline (WCAG) asks for a contrast ratio of at least 4.5 to 1 between normal text and its background, and 3 to 1 for large text. Light grey text on white, or white text on yellow, fails even though it may look elegant.
- Colours shift between screens and print. A screen mixes light (RGB); a printer mixes ink (CMYK). Very bright greens, blues and oranges cannot be printed exactly. Ask the print shop for a proof when the colour matters.
Background on colour models is in Understanding web colors.
Frequently Asked Questions
What is the difference between HEX and RGB?
They represent the same color model in different number systems. HEX uses base-16, RGB uses base-10. #FF0000 and rgb(255, 0, 0) are both pure red.
When should I use HSL instead of HEX?
HSL is ideal for creating color variations — easily adjust lightness or saturation, which is not intuitive in HEX or RGB.
What does the alpha channel mean?
Alpha controls transparency, from 0 (fully transparent) to 1 (fully opaque). Used in rgba() and hsla() CSS functions.
Can I pick colors from my screen?
On supported browsers (Chrome, Edge), you can use the EyeDropper API to pick any color on screen.