CSS named color
Grey #808080
Grey (CSS keyword grey) has the hex code #808080 and the RGB value rgb(128, 128, 128): a medium neutral gray.
British spelling of gray, with the same value (#808080). Both spellings are valid for all seven gray keywords in CSS Color Level 4.
The keyword gray has exactly the same value (#808080); browsers treat them as the same color.
Color codes for Grey
| CSS keyword | grey |
|---|---|
| HEX | #808080 |
| RGB | rgb(128, 128, 128) |
| HSL | hsl(0, 0%, 50%) |
| HWB | hwb(0 50% 50%) |
| OKLCH | oklch(60% 0 0) |
| CMYK (naive, no ICC profile) | cmyk(0%, 0%, 0%, 50%) |
| Decimal | 8,421,504 |
| Hue family | Grays and black |
| Same value as | gray |
Contrast and accessibility
On grey, black text has a contrast ratio of 5.31:1 and passes AA for normal text; white text reaches 3.94:1.
WCAG 2.2 contrast ratios (success criteria 1.4.3 and 1.4.6: AA needs 4.5:1 for normal text and 3:1 for large text, AAA needs 7:1 and 4.5:1). APCA Lc is the lightness contrast from the APCA-W3 0.0.98G model proposed for WCAG 3; a higher absolute value is more readable, and Lc 75 is its suggested minimum for body text.
| Pair | Ratio | AA | AA large | AAA | AAA large | APCA Lc |
|---|---|---|---|---|---|---|
| Black text on grey | 5.31:1 | Pass | Pass | Fail | Pass | 37.2 |
| White text on grey | 3.94:1 | Fail | Pass | Fail | Fail | −72.4 |
| Grey text on white | 3.94:1 | Fail | Pass | Fail | Fail | 66.9 |
| Grey text on black | 5.31:1 | Pass | Pass | Fail | Pass | −34.8 |
Tints and shades
Each step mixes grey with white (tints) or black (shades) in gamma-encoded sRGB, the same result as color-mix(in srgb, grey, white 25%) in CSS.
Tints (mixed with white)
- 5%
#868686 - 15%
#939393 - 25%
#a0a0a0 - 35%
#acacac - 45%
#b9b9b9 - 55%
#c6c6c6 - 65%
#d3d3d3 - 75%
#dfdfdf - 85%
#ececec - 95%
#f9f9f9
Shades (mixed with black)
- 5%
#7a7a7a - 15%
#6d6d6d - 25%
#606060 - 35%
#535353 - 45%
#464646 - 55%
#3a3a3a - 65%
#2d2d2d - 75%
#202020 - 85%
#131313 - 95%
#060606
Color harmonies
Rotating the hue in OKLCH while keeping lightness and chroma, grey's complementary color is #808080 (close to gray), its analogous colors are #808080 and #808080, and its triadic partners are #808080 and #808080. For text on top, black gives the higher contrast.
| Harmony | Rotation | Color |
|---|---|---|
| Complementary | +180° | #808080 |
| Analogous | −30°, +30° | #808080#808080 |
| Triadic | +120°, +240° | #808080#808080 |
| Split-complementary | +150°, +210° | #808080#808080 |
Computed in OKLCH: the hue is rotated by 180° (complementary), ±30° (analogous), ±120° (triadic) and 180° ±30° (split-complementary) while lightness and chroma stay fixed. Results that fall outside sRGB are brought back with the CSS Color 4 gamut mapping algorithm. Because this uses OKLCH, the values differ from tools that rotate hue in HSL, but every color keeps the same perceived lightness.
Warm or cool?
Grey is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.
Nearest named and Tailwind colors
Distance is ΔE OK, the Euclidean distance in OKLab multiplied by 100. Values under about 2 are hard to tell apart side by side.
Nearest CSS named colors
| Color | HEX | ΔE OK |
|---|---|---|
| slategray | #708090 | 3.2 |
| lightslategray | #778899 | 3.8 |
| dimgray | #696969 | 7.9 |
Nearest Tailwind v4 colors
| Color | HEX | ΔE OK |
|---|---|---|
| olive-500 | #7c7c67 | 3.7 |
| neutral-500 | #737373 | 4.4 |
| mist-500 | #67787c | 4.5 |
Code snippets
.element {
color: grey;
background-color: #808080;
border-color: rgb(128 128 128);
outline-color: oklch(60% 0 0);
}<div class="bg-[#808080] text-black">...</div>
/* or register it once in your CSS (Tailwind v4) */
@theme {
--color-grey: #808080;
}
/* then use bg-grey, text-grey, border-grey */import SwiftUI
extension Color {
static let grey = Color(red: 0.502, green: 0.502, blue: 0.502)
}import androidx.compose.ui.graphics.Color
val Grey = Color(0xFF808080)import 'package:flutter/material.dart';
const grey = Color(0xFF808080);<!-- res/values/colors.xml -->
<color name="grey">#808080</color>Frequently asked questions
- What is the hex code for grey?
- The hex code for grey is #808080. The same color is rgb(128, 128, 128), hsl(0, 0%, 50%) and oklch(60% 0 0), and in CSS you can also write the keyword grey directly.
- Is grey a warm or cool color?
- Grey is close to neutral: its OKLCH chroma is only 0.000, so its temperature comes from context. It has no perceptible hue.
- What colors go with grey?
- Rotating the hue in OKLCH while keeping lightness and chroma, grey's complementary color is #808080 (close to gray), its analogous colors are #808080 and #808080, and its triadic partners are #808080 and #808080. For text on top, black gives the higher contrast.
- Can you use white text on grey?
- White text on grey has a contrast ratio of 3.94:1, which passes AA only for large text (24 px, or 18.66 px bold, and up) under WCAG 2.2. Black text reaches 5.31:1 and passes AA for normal text but not AAA. In APCA terms that is Lc −72.4 for white and Lc 37.2 for black.
- Is grey the same as gray?
- Yes. Both keywords are #808080 (rgb(128, 128, 128)). CSS Color 4 keeps both for compatibility, so use whichever your codebase already uses.
Last reviewed by Arielton Oberek.