Skip to content

Grey Color

CSS grey #808080 — equal red, green and blue at 128. Both spellings, grey and gray, work.

HEX
#808080
RGB
rgb(128, 128, 128)
HSL
hsl(0, 0%, 50.2%)
HSV
hsv(0, 0%, 50.2%)
CMYKapproximation
cmyk(0%, 0%, 0%, 50%)
CSS name
grey

Open grey in the color picker to adjust it or copy other formats.

About grey

CSS accepts both spellings: grey and gray are the same color, #808080, with every channel at 128. Every shade of gray has equal R, G and B values; only the level changes.

Mathematically #808080 is the middle of the 0–255 range, but it does not look like a perfect mid-gray, because screen values are gamma-encoded. There is also a well-known CSS quirk inherited from the old X11 color list: darkgray (#A9A9A9) is lighter than gray.

#808080 is the value of the CSS named color grey, defined in the CSS Color specification and identical in every browser.

Other colors called grey

  • Dim gray (CSS) #696969Darker, readable as body text on white.
  • Dark gray (CSS) #A9A9A9Despite the name, lighter than gray.

Grey shades and tints

Shades mix grey with black, tints mix it with white — useful for hover states, borders and backgrounds. Click a swatch to copy its HEX code.

Colors that go with grey

Grey is a neutral with no hue, so it has no complementary or triadic colors of its own. Neutrals go with almost any color — pick an accent in the color wheel or the palette generator.

Grey contrast and readability

On a grey background, black text reads best (5.31:1). Here is how grey works as a text color:

#808080 on white

3.94:1

Normal text sample

Large text

  • AA normal text (4.5:1)Fail
  • AA large text (3:1)Pass
  • AAA normal text (7:1)Fail
  • AAA large text (4.5:1)Fail

#808080 on black

5.31:1

Normal text sample

Large text

  • AA normal text (4.5:1)Pass
  • AA large text (3:1)Pass
  • AAA normal text (7:1)Fail
  • AAA large text (4.5:1)Pass

#808080 is readable on white only for large text. For body text, use a darker gray such as dimgray (#696969) or #595959; use lighter grays for borders, dividers and disabled states.

Using grey in CSS and HTML

CSS custom property
:root {
  --color-grey: #808080;
}

.highlight {
  background-color: var(--color-grey);
}
Background and text color
.banner {
  background-color: grey;
  color: #000000;
}

.label {
  color: #808080;
  border: 2px solid rgb(128, 128, 128);
}
Inline style in HTML
<p style="background-color: #808080; color: #000000;">
  Grey background
</p>