Gray Color Code (#808080)

Gray is #808080 in hex and rgb(128, 128, 128) — a medium gray. Below: every color format, tints and shades, harmonies and how readable it is as text.

Updated

Gray
#808080
CSS namegray (also grey)
Hex#808080
RGBrgb(128, 128, 128)
HSLhsl(0 0% 50%)
HWBhwb(0 50% 50%)
CMYK0%, 0%, 0%, 50%

Tints and shades

About Gray

Gray (gray) is a medium, muted gray with the hex code #808080, or rgb(128, 128, 128). In HSL it sits at a hue of 0°, 0% saturation and 50% lightness. CSS also accepts the spelling grey for exactly the same color. It is one of the 148 named colors every browser understands, so you can write color: gray; instead of the hex value.

Using Gray for text and backgrounds

PairingContrast ratioWCAG
Gray text on white3.95 : 1AA large text only
Gray text on black5.32 : 1AA

On a gray background, use black text (5.32 : 1). WCAG asks for at least 4.5 : 1 for body text and 3 : 1 for large text. Check other pairs with the Contrast Checker.

CSS

.element {
  color: gray;               /* or #808080 */
  background-color: #808080;
  border: 1px solid rgb(128 128 128 / 50%);
}

Similar named colors

Slate Gray (#708090), Light Slate Gray (#778899), Dim Gray (#696969), Cadet Blue (#5f9ea0), Dark Sea Green (#8fbc8f), Rosy Brown (#bc8f8f).

Color Name FinderPaste a HEX code to get its closest human-readable name and clean token names for your CSS, SCSS, JavaScript or Tailwind config.
Open the tool

Frequently asked questions

What is the hex code for gray?
#808080 — that is rgb(128, 128, 128) and hsl(0, 0%, 50%). In CSS you can also just write gray.
Is gray text readable on white?
Its contrast ratio on white is 3.95 : 1, which passes only for large text (WCAG AA large).
What colors go well with gray?
Gray is a neutral, so it pairs with almost any color; use it for backgrounds, borders and text around a stronger accent.