Hex codes look cryptic, but they are just RGB numbers written in base 16. Once you know the pattern you can guess a colour from its code. To convert any code instantly, use our free hex to RGB converter.
What does #RRGGBB mean?
The # says "this is a hex colour". Then come three pairs: RR for red, GG for green and BB for blue. Each digit is 0 to 9 or A to F, where A is 10 and F is 15, so each pair goes from 00 (0) to FF (255) (MDN: hex-color).
With 256 levels for each of three channels, there are 256 × 256 × 256 = 16,777,216 possible six-digit hex colours.
How to convert a hex pair to a number
Multiply the first digit by 16 and add the second. For #EF466F:
| Pair | Maths | Value |
|---|---|---|
| EF (red) | 14 × 16 + 15 | 239 |
| 46 (green) | 4 × 16 + 6 | 70 |
| 6F (blue) | 6 × 16 + 15 | 111 |
So #EF466F = rgb(239, 70, 111): lots of red, a little blue, not much green. That is a warm pink, the Digital Sauce brand colour.
How to guess a colour from its code
- The biggest pair wins. If red is highest, the colour leans red; if red and blue are both high, it is pink or purple.
- All three pairs equal means grey.
#333333is dark grey,#CCCCCClight grey. - Higher overall means lighter. Codes full of E and F are pale; codes full of 0 to 3 are dark.
- A small spread means a muted colour.
#8A7F86has pairs close together, so it is a greyish mauve;#FF1A6Bhas a big spread, so it is vivid.
| Hex | RGB | What it looks like |
|---|---|---|
#FFFFFF | 255, 255, 255 | White |
#000000 | 0, 0, 0 | Black |
#FF0000 | 255, 0, 0 | Pure red |
#00FF00 | 0, 255, 0 | Pure green |
#0000FF | 0, 0, 255 | Pure blue |
#FFFF00 | 255, 255, 0 | Yellow (red + green light) |
#808080 | 128, 128, 128 | Mid grey |
#141414 | 20, 20, 20 | Near-black |
What are 3-digit hex codes?
If both digits in every pair are the same, you can write each pair once. #FFF is #FFFFFF, #F46 is #FF4466. It only works for those doubled codes, so #EF466F has no shorthand. There are also 4 and 8-digit versions with transparency; see hex colour with opacity.
Where are hex codes used?
Everywhere colours are written down: CSS, Figma, Sketch, Canva, brand guidelines and most design tokens. Code for apps often needs RGB or 0–1 values instead, which is where a hex to RGB converter saves time. For when to pick hex, RGB or HSL in CSS, read HSL vs RGB vs hex.
Hex to RGB converterConvert hex colour codes to RGB, RGBA and HSL, and back. Free, no sign-up, runs in your browser.
Open the tool →FAQ
What is a hex colour code?
It is a way to write an RGB colour as six hexadecimal digits after a #. Each pair sets the amount of red, green and blue from 00 to FF.
How many hex colours are there?
There are 16,777,216 six-digit hex colours, because each of the three channels has 256 possible values and 256 × 256 × 256 = 16,777,216.
What hex code is white?
White is #FFFFFF, or #FFF for short. Black is #000000, or #000.
Why do hex codes use letters?
Hexadecimal is base 16, so it needs sixteen digits. After 0 to 9 it uses A to F for the values 10 to 15.
Are hex codes case-sensitive?
No. #ef466f and #EF466F are exactly the same colour. Pick one style and use it consistently in your code and design files.
Read next
- Hex colour with opacity: 8-digit hex codes explainedThe alpha table for #RRGGBBAA, 0 to 100%
- HSL vs RGB vs hex: which colour format should you use?Same colours, different jobs
- Hex to RGB converterConvert hex colour codes to RGB, RGBA and HSL, and back
- All free design toolsConverters, calculators and colour tools
Last updated 16 November 2026. Sources are linked in the text. Spotted something out of date? Email development@digitalsauce.io.
