Gray Color Code: Hex #808080
The hex code for Gray is #808080 (the CSS keyword gray). Gray RGB code: rgb(128, 128, 128). The xkcd color survey gives #929591 instead, which looks slightly different; both codes are below with their source.
#808080Top: the code browsers use#929591Below: compare edge to edgeGray color codes: each Gray hex code in every format
Sources
Properties
- Hex codes
- 2 different ones in 3 color lists; they look slightly different
- Family
- gray
- Contrast
- 3.95:1 with white, 5.32:1 with black
- CSS keyword
- gray
- Also written
- grey
- Character
- mid-tone, near-neutral
- Readable text on it
- black (AA)
HTML reserves gray for 50% gray; in the older X11 list gray was a much lighter 74.5% gray, close to the web’s silver.
A mid-tone, almost neutral tint. In code, gray gives exactly this web value. If you mean the color as people usually picture the name, the survey value #929591 is closer: it is lighter and about as saturated.
Black text reads best on it; white text works only for large headings. Next to Dim Gray, its closest named neighbour, it looks lighter, about as saturated and neither warmer nor cooler; beside Slate Gray it looks about as light, more muted and warmer. It is one of the 16 original HTML 4 color names.
Colors that go with Gray
Complementary: the opposite of Gray
#808080Black text 5.32:1#808080Black text 5.32:1#B7B7B7Black text 10.47:1#4D4D4DWhite text 8.45:1
Analogous
#808080Black text 5.32:1#808080Black text 5.32:1#808080Black text 5.32:1#CACACABlack text 12.81:1
Triadic
#808080Black text 5.32:1#808080Black text 5.32:1#808080Black text 5.32:1#DEDEDEBlack text 15.61:1
Monochrome
#1F1F1FWhite text 16.48:1#4D4D4DWhite text 8.45:1#808080Black text 5.32:1#A4A4A4Black text 8.42:1#CACACABlack text 12.81:1
With neutrals
#808080Black text 5.32:1#DEDEDEBlack text 15.61:1#0B0B0BWhite text 19.68:1#808080Black text 5.32:1
Preview
Heading on Gray
Body text on this color, 5.32:1.
ButtonHeading in Gray
Text in this color on white, 3.95:1.
ButtonTints and shades
#DEDEDE#CACACA#B7B7B7#A4A4A4#929292#808080#666666#4D4D4D#353535#1F1F1F#0B0B0B
WhiteGrayBlack
Similar named colors
Where the name comes from
- Source: Wikipedia, “X11 color names” (checked 3 Nov 2026)
- Listed in CSS Color 4, xkcd color survey, meodai color-name-list. About these lists.
Try it: