The pattern behind every hex color
A hex color like #FF5733 is three pairs of characters: FF (red), 57 (green), 33 (blue). Each pair is a number from 00 to FF in hexadecimal — which is 0 to 255 in normal decimal. So #FF5733 means red 255, green 87, blue 51: a warm orange-red.
Why base 16?
Hexadecimal (base 16) uses digits 0–9 then A–F for 10–15. Two hex digits express exactly one byte (0–255), which maps perfectly to one color channel. That's why colors are two characters per channel.
Reading colors quickly
#000000= all zero = black.#FFFFFF= all max = white.#FF0000= pure red,#00FF00= pure green,#0000FF= pure blue.- Equal values (
#808080) always make a shade of gray. - Shorthand:
#F53expands to#FF5533.
Hex vs RGB vs HSL
Hex and rgb(255,87,51) are the same thing written differently. HSL (hue, saturation, lightness) is a third way that's easier for humans to adjust — but browsers treat them all identically.
Frequently Asked Questions
What does the # mean in a color code?
The # (hash) simply signals that what follows is a hexadecimal color value. It has no numeric meaning itself.
Can hex codes include transparency?
Yes — an 8-digit hex adds a fourth pair for alpha (opacity), e.g. #FF573380 is the same color at 50% opacity.
Why do some codes have only 3 characters?
3-digit hex is shorthand where each digit is doubled: #F53 becomes #FF5533. It only works when both digits of each pair match.