#808080: CSS gray color codes, contrast and shades
By TechCompare · Updated · How we check
#808080 is rgb(128, 128, 128), the CSS named color gray, with all three channels at 128. As text on white it gets 3.95:1, which only passes for large text.
Color Codes
- HEX
#808080 - RGB
rgb(128, 128, 128) - HSL
hsl(0, 0%, 50%) - OKLCH
oklch(59.99% 0 0)
Text on #808080
White Text
Aa
The quick brown fox jumps over the lazy dog.
3.95:1APCA Lc -72.4
- AA Normal (4.5:1)Fail
- AA Large (3:1)Pass
- AAA Normal (7:1)Fail
- AAA Large (4.5:1)Fail
Black Text
Aa
The quick brown fox jumps over the lazy dog.
5.32:1APCA Lc 37.2
- AA Normal (4.5:1)Pass
- AA Large (3:1)Pass
- AAA Normal (7:1)Fail
- AAA Large (4.5:1)Pass
WCAG 2 ratios are the same whichever color is the text, so they also hold for #808080 text on a white or black page. APCA is a newer method that isn't part of any WCAG standard, and a minus sign means light text on dark.
#808080 sets red, green and blue to the same value, 128, so it has no hue at all. It's the CSS color gray, which you can also spell grey. The cards above give its codes and test white and black text on it. Below are 4 lighter and 4 darker shades, all neutral.
Shades
Same hue and chroma in OKLCH, with even steps of lightness. Open any shade in the Color Picker.
Nearest Named Colors
CSS Name
gray or grey
#808080
ExactΔE OK 0.000Tailwind 4
olive-500
oklch(58% 0.031 107.3)
CloseΔE OK 0.037Tailwind 3
neutral-500
#737373
CloseΔE OK 0.044
About #808080
CSS gray names don't line up the way they read. The name gray comes from the old VGA palette, while darkgray, #A9A9A9, comes from the X11 list. So darkgray is the lighter of the two, at an OKLCH lightness of 73.48% against 59.99%. The CSS spec itself points this out.
Halfway in code isn't halfway in light. The channel value sits at about the middle of its range, but screens don't turn values into light in a straight line, so #808080 gives off less than a quarter of the light of white. That's also why white text on it only reaches 3.95:1.
For text on it, WCAG 2 picks black at 5.32:1 over white at 3.95:1. APCA, a newer method that isn't part of any WCAG standard, leans the other way, at Lc -72.4 for white and Lc 37.2 for black. If you want gray body text on white that passes AA, #767676 is the lightest neutral gray that does, at 4.54:1. #777777 already falls short at 4.48:1.
Verdict
Use #808080 for borders, dividers, icons and input outlines on white. At 3.95:1 it clears the 3:1 that WCAG 2.1 asks for parts of a control people need to see. Keep it off normal size text on white, where it fails AA.
One step down the scale, #6A6A6A, gets white text and text on white to 5.41:1 and passes AA. The lighter steps fall under 3:1 against white, so use them for backgrounds and disabled states, not for borders that have to show. Click a shade to open it in the Color Picker.
More Color scenarios
Related guides
Frequently asked questions
What color is #808080?
Is #808080 lighter or darker than darkgray?
Does #808080 text pass WCAG on white?
Related tools
Contrast Checker
Check color contrast ratios for WCAG AA/AAA accessibility compliance.
Use toolJSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolAspect Ratio Visualizer
Visually compare width differences between 16:9, 21:9, and 32:9 monitors.
Use tool