Hex color codes

Hex codes for the colors people look up most, each with RGB, HSL, OKLCH and CMYK values, shades, matching palettes and text contrast. Every color here is a CSS named color, so the name works in a stylesheet too.

Common colors and their codes

ColorNameHEXRGBHSLCSS name
Gold#FFD700rgb(255, 215, 0)hsl(51, 100%, 50%)gold
Pink#FFC0CBrgb(255, 192, 203)hsl(350, 100%, 88%)pink
Red#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)red
Blue#0000FFrgb(0, 0, 255)hsl(240, 100%, 50%)blue
Green#008000rgb(0, 128, 0)hsl(120, 100%, 25%)green
Yellow#FFFF00rgb(255, 255, 0)hsl(60, 100%, 50%)yellow
Purple#800080rgb(128, 0, 128)hsl(300, 100%, 25%)purple
White#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)white
Brown#A52A2Argb(165, 42, 42)hsl(0, 59%, 41%)brown
Black#000000rgb(0, 0, 0)hsl(0, 0%, 0%)black
Orange#FFA500rgb(255, 165, 0)hsl(39, 100%, 50%)orange
Gray#808080rgb(128, 128, 128)hsl(0, 0%, 50%)gray
Navy blue#000080rgb(0, 0, 128)hsl(240, 100%, 25%)navy
Silver#C0C0C0rgb(192, 192, 192)hsl(0, 0%, 75%)silver
Hot pink#FF69B4rgb(255, 105, 180)hsl(330, 100%, 71%)hotpink
Teal#008080rgb(0, 128, 128)hsl(180, 100%, 25%)teal
Royal blue#4169E1rgb(65, 105, 225)hsl(225, 73%, 57%)royalblue
Maroon#800000rgb(128, 0, 0)hsl(0, 100%, 25%)maroon
Beige#F5F5DCrgb(245, 245, 220)hsl(60, 56%, 91%)beige
Sky blue#87CEEBrgb(135, 206, 235)hsl(197, 71%, 73%)skyblue

How hex color codes work

A hex color code is a # followed by three pairs of hexadecimal digits for red, green and blue. Each pair runs from 00 (none) to FF (255, full strength), so #FFD700 is red 255, green 215 and blue 0. Three-digit codes are a shorthand that doubles each digit: #FFF is #FFFFFF.

Hex codes with transparency

A fourth pair of digits sets opacity (alpha), from 00 (fully transparent) to FF (opaque). #FFD70080 is gold at about 50%, because 80 in hex is 128 of 255. The short form takes a fourth digit too: #FFF8 is #FFFFFF88. The same color in modern CSS is rgb(255 215 0 / 50%).

Where the color names come from

12 of the colors here, such as red, navy and teal, are among the original 16 HTML 4.01 color names. CSS 2.1 added orange, and the rest, such as gold and hotpink, came from the X11 color names adopted in CSS Color 3.

The colors on this page use the CSS named color values, which every browser understands. For all 148 names, see the color names list. To convert any other color, use the color converter, or pick one from a photo with the image color picker.