🎨

Hex color

Hexadecimal format (#RRGGBB) is the most common notation for specifying colors in CSS, HTML, and digital design. Each color is represented with 6 hexadecimal digits (base 16: 0-9, A-F), divided into three pairs encoding the intensity of red, green, and blue (RGB) in values from 0 (00) to 255 (FF).

Examples

  • #FF0000 (pure red: R=255, G=0, B=0)
  • #00FF00 (pure green: R=0, G=255, B=0)
  • #0000FF (pure blue: R=0, G=0, B=255)
  • #FFFFFF (white: R=255, G=255, B=255)
  • #000000 (black: R=0, G=0, B=0)
  • #FF5733 (reddish orange: R=255, G=87, B=51)
  • #3A7FD5 (medium blue: R=58, G=127, B=213)
  • #FFF or #FFFFFF (short notation)
  • #FF000080 (red with 50% opacity)

FAQ

What's the difference between #RGB and #RRGGBB?

Short notation (#RGB) is a shortcut: each digit is duplicated. #F00 = #FF0000, #ABC = #AABBCC. Use it for common colors; for precision (e.g., #3A7FD5), you need 6 digits. Both are valid in CSS.

How do I add transparency to a hex?

Use 8 digits: #RRGGBBAA. The last two are the alpha channel (00=transparent, FF=opaque). Example: #FF000080 is red with 50% opacity. Alternative: rgba(255, 0, 0, 0.5) is more readable but less compact.

Does hex work the same on all monitors?

In theory yes (sRGB standard), but poorly calibrated monitors display colors differently. For critical precision (branding, printing), calibrate monitors with colorimeters. On web, hex is consistent enough for most cases.