ColorPickerTools

What Is a Hex Color?

A hex color is a six-digit code, like #3B82F6, that is just the red, green and blue channels of a color written in base 16. Once you see it that way, the notation stops being mysterious and becomes something you can read at a glance.

Quick answer: A hex color is a hash followed by six hexadecimal digits in three pairs — #RRGGBB — where each pair is one channel (red, green, blue) from 00 to FF (0–255 in decimal). #FF0000 is pure red; #FFFFFF is white.

Reading the digits

Each pair is a channel value in base 16. Two hex digits cover 00–FF, which is 0–255 in decimal — exactly the range of an 8-bit color channel. So #3B82F6 means red 3B (59), green 82 (130), blue F6 (246).

  • 00 is the minimum (channel off)
  • FF is the maximum (channel full)
  • 80 is the midpoint (≈50%)

Why base 16

Hex is compact and maps cleanly onto bytes. Two digits per channel makes a full 24-bit color fit into six characters, which is why early web and graphics formats adopted it and why it stuck.

Shorthand and alpha

A three-digit form like #F00 is shorthand for #FF0000, used when both digits of each pair are identical. An eight-digit form adds a pair for alpha (#RRGGBBAA), where 00 is transparent and FF is opaque.

Hex vs RGB vs HSL

All three describe the same color. Hex and RGB store channels directly; HSL stores hue, saturation and lightness, which is easier to adjust by hand. Converters translate between them without changing the color.

Frequently Asked Questions

Is #RGB always expandable to #RRGGBB?
Yes, when each of the three digits is duplicated: #F0A becomes #FF00AA. If the pairs differ, you need the six-digit form.
Are hex colors case-sensitive?
No. #3b82f6 and #3B82F6 are identical; this site displays the uppercase form for readability.
Can a hex color be outside sRGB?
The plain #RRGGBB notation describes sRGB (with the CSS Color 4 extensions for other spaces). Wider gamuts need a different function such as color(display-p3 …).

Related Tools