Colour Picker guide
How to find the HEX code of a colour: on your screen, in a photo or on a website
To find the HEX code of a colour you can see, use an eyedropper: in Chrome or Edge on a computer, Colour Picker's Eyedropper reads any pixel on your screen. On a phone, open a screenshot or photo in a colour picker and tap the spot. For a website, the exact code is in its CSS, which your browser's developer tools show in two clicks.
What a HEX code is
Screens mix every colour from red, green and blue light. A HEX code writes those three amounts as pairs of hexadecimal digits (0–9 then A–F), from 00 for none to FF for full, which is 255:
Reading #FF6B35
FF red = 255 · 6B green = 107 · 35 blue = 53, so #FF6B35 is rgb(255, 107, 53): a warm orange.
The same colour can be written in other ways, and Colour Picker shows all of them side by side: RGB, HSL (hue, saturation, lightness, handy for making a colour lighter or darker in CSS), HSV or HSB (what most design apps' pickers use) and CMYK (an approximation for print; real print colour depends on the printer and paper).
From anywhere on your screen
In Chrome or Edge on a computer, the browser can lend a web page an eyedropper:
- Open Colour Picker and press Eyedropper. The pointer becomes a magnifier.
- Click the colour you want, anywhere on your screen: another tab, a PDF, a design app, a video. Press Esc to cancel.
- Tap the HEX code to copy it, or the copy button next to RGB, HSL, HSV or CMYK.
Safari and Firefox don't offer the eyedropper to web pages yet, so the button only appears where it works. Two built-in tools do the same job:
- Mac: Digital Color Meter, in Applications › Utilities. Choose View › Display Values › Hexadecimal, point at the colour and press Shift ⌘ C to copy it as text.
- Windows: the free Microsoft PowerToys includes a Color Picker; press Win Shift C and click.
From a photo or screenshot (and on a phone)
Phones don't let web pages read other apps' pixels, so take a screenshot first. Then:
- In Colour Picker, press Photo and choose the screenshot or photo. On a computer you can also drop or paste an image.
- Touch and drag on the image. A loupe magnifies the pixels under your finger, with the exact pixel framed in the middle, so your finger never hides what you're picking.
- Let go to pick it. The colour goes to your recent colours, and every format is ready to copy.
The image is read inside your browser and never uploaded.
From a website
A picked pixel can be off by a shade (smooth edges, gradients, image compression). For the exact colour a site uses, read its CSS:
- Right-click the element and choose Inspect (in Safari, first turn on Settings › Advanced › Show features for web developers).
- Find
color,background-colororborder-colorin the Styles panel. The small square beside the value is the colour. - Copy the value. If it's written as
rgb(),hsl()or a name liketomato, paste it into any field in Colour Picker to get the HEX code.
Converting RGB to HEX by hand
Each RGB number from 0 to 255 becomes two hex digits: divide by 16; the whole part is the first digit and the remainder is the second, where 10–15 are written A–F.
Worked example: rgb(42, 157, 143)
42 ÷ 16 = 2 remainder 10 → 2A
157 ÷ 16 = 9 remainder 13 → 9D
143 ÷ 16 = 8 remainder 15 → 8F
So the HEX code is #2A9D8F.
Going the other way, multiply the first digit by 16 and add the second: 6B is 6 × 16 + 11 = 107. Or type either form into Colour Picker and copy the other.
Common colours and their HEX codes
| Colour | HEX | RGB |
|---|---|---|
| White | #FFFFFF | 255, 255, 255 |
| Black | #000000 | 0, 0, 0 |
| Red | #FF0000 | 255, 0, 0 |
Green (CSS lime) | #00FF00 | 0, 255, 0 |
| Blue | #0000FF | 0, 0, 255 |
Grey (CSS gray) | #808080 | 128, 128, 128 |
| Orange | #FFA500 | 255, 165, 0 |
| Gold | #FFD700 | 255, 215, 0 |
| Navy | #000080 | 0, 0, 128 |
| Teal | #008080 | 0, 128, 128 |
Colour Picker also shows the nearest of CSS's 140-odd named colours for whatever you pick, which is handy when you need a word for a colour.
Common mistakes
- Picking on an edge. Text and shape edges blend into the background; pick from the middle of the area.
- Picking from a dimmed or night-shifted screen. Night Shift and True Tone change what you see, but an eyedropper reads the real pixel, so trust the code over your eyes.
- Treating CMYK from a screen colour as exact. It's a starting point; ask your printer for a proof when colour matters.
- Mixing up 8-digit codes. The last two digits of
#RRGGBBAAare opacity, not part of the colour.
Questions
What is a HEX colour code?
A six-digit code such as #FF6B35 that gives the red, green and blue parts of a screen colour, two hexadecimal digits each, from 00 (none) to FF (full, 255).
Are HEX codes case-sensitive?
No. #ff6b35 and #FF6B35 are the same colour in CSS, design apps and HTML. Use whichever your team prefers, and be consistent.
What does a 3-digit HEX code like #F63 mean?
It is shorthand: each digit is doubled, so #F63 is #FF6633. Only colours whose pairs repeat can be written this way.
What is an 8-digit HEX code?
The last two digits are opacity (alpha): #FF6B3580 is #FF6B35 at about 50% opacity. 00 is fully transparent and FF is fully opaque.
Why is the colour I picked slightly different from the brand colour?
Photos, JPEG compression, screen colour profiles and anti-aliased edges all shift pixels a little. For an official colour, use the brand guidelines or the website's CSS rather than a picked pixel.