Gray color codes
| CSS name | gray |
|---|---|
| HEX | #808080 |
| RGB | rgb(128, 128, 128) |
| HSL | hsl(0, 0%, 50%) |
| CMYK | cmyk(0%, 0%, 0%, 50%) |
| Decimal | 8421504 |
Shades of Gray (darker)
#737373 · #666666 · #5A5A5A · #4D4D4D · #404040 · #333333 · #262626 · #1A1A1A · #0D0D0D
Tints of Gray (lighter)
#8D8D8D · #999999 · #A6A6A6 · #B3B3B3 · #C0C0C0 · #CCCCCC · #D9D9D9 · #E6E6E6 · #F2F2F2
Color harmonies
| Complementary | #808080 |
|---|---|
| Triadic | #808080, #808080 |
| Analogous | #808080, #808080 |
Accessibility (WCAG contrast)
| White text on Gray | 3.95:1 · AA large text only |
|---|---|
| Black text on Gray | 5.32:1 · AA |
Use Gray in code
.element {
color: gray; /* or #808080 */
background-color: rgb(128 128 128 / 0.5);
}Frequently asked questions
What is the hex code for Gray?
Gray is #808080 in HEX, rgb(128, 128, 128) in RGB and hsl(0, 0%, 50%) in HSL.
Can I use "gray" directly in CSS?
Yes. "gray" is one of the 148 standard CSS named colors, so color: gray; works in every browser.
Is Gray readable on white?
The contrast ratio of Gray on white is 3.95:1 (WCAG AA large text only). On black it is 5.32:1 (AA).
What is the complementary color of Gray?
The complementary color (opposite on the color wheel) is #808080.
Similar colors
Slate Gray#708090Slate Grey#708090Light Slate Gray#778899Light Slate Grey#778899Dim Gray#696969Dim Grey#696969Cadet Blue#5F9EA0Dark Sea Green#8FBC8F
Convert any color with the Color Converter, generate palettes with the Random Color Generator, or browse all 148 CSS color names.