Color Converter (HEX, RGB, HSL)→Specialized Version
🎨

Gray HEX Code

Gray color HEX code

HEX in
#808080
RGB out
rgb(128, 128, 128)
RGB
HSL

All formats

Lightness variations

Gray HEX Code

The HEX code for gray is #808080. Gray is created when red, green, and blue values are equal, producing a neutral tone. Gray is essential in UI design for backgrounds, borders, text, and creating visual hierarchy without distraction.

Gray Color Values

FormatValue
HEX#808080
RGBrgb(128, 128, 128)
HSLhsl(0, 0%, 50%)
CMYKC:0 M:0 Y:0 K:50

Gray Scale Variations

ShadeHEXRGBDescription
White Smoke#F5F5F5245Very light
Gainsboro#DCDCDC220Light gray
Light Gray#D3D3D3211Soft gray
Silver#C0C0C0192Medium light
Dark Gray#A9A9A9169Medium dark
Gray#808080128True middle
Dim Gray#696969105Dark
Charcoal#36454F-Very dark

Gray in UI Design

Gray is the workhorse of interface design:

``css :root { /* Text grays */ --text-primary: #1F2937; --text-secondary: #6B7280; --text-muted: #9CA3AF;

/* Background grays */ --bg-light: #F9FAFB; --bg-muted: #F3F4F6;

/* Border grays */ --border-light: #E5E7EB; --border-default: #D1D5DB; } `

Tailwind Gray Scale

LevelHEXUse Case
50#F9FAFBSubtle backgrounds
100#F3F4F6Page backgrounds
200#E5E7EBBorders, dividers
300#D1D5DBDisabled text
400#9CA3AFPlaceholder text
500#6B7280Secondary text
600#4B5563Icons
700#374151Primary text
800#1F2937Headings
900#111827Near black

Warm vs Cool Grays

TypeUndertoneHEX ExampleUse
Warm GrayRed/yellow#78716CCozy, natural
Cool GrayBlue#6B7280Modern, tech
True GrayNone#808080Neutral

Gray Spelling: Gray vs Grey

Both spellings are correct:

  • Gray: American English
  • Grey: British English
In CSS, use "gray" for keywords (e.g., gray, darkgray).

Gray Accessibility

Text ColorBackgroundContrastWCAG
#6B7280#FFFFFF5.0:1AA
#4B5563#FFFFFF7.5:1AAA
#9CA3AF#FFFFFF3.0:1AA Large
Use darker grays (#4B5563 or darker) for body text on white backgrounds.

A Full Ramp From This Colour

Design systems settle on a 50–900 scale because it covers backgrounds, borders, text and states without anyone reaching outside the palette. Mixing toward white and black rather than adjusting HSL lightness keeps more of the hue's character:

StepColourContrast on whiteSafe for
50#F5F9FF1.06:1backgrounds and fills
100#EBF3FE1.12:1backgrounds and fills
200#CEE0FD1.34:1backgrounds and fills
300#B1CDFB1.62:1backgrounds and fills
400#76A8F92.40:1backgrounds and fills
500#3B82F63.68:1large text, borders
600#326FD14.85:1body text on white
700#295BAC6.59:1body text on white
800#2048878.98:1body text on white
900#18346212.31:1body text on white
The contrast column is the one that decides usage. Steps below 3:1 cannot carry text at any size and belong in fills and dividers; steps at 4.5:1 and above are safe for body copy.

Adjusting It

Base colour in HSL is hsl(217, 91%, 60%). Two useful moves:

`css /* +10% lightness, same hue */ --lighter: #6da2f8; /* −10% lightness */ --darker: #0b64f4; ``

Raising lightness also drops perceived saturation, so a lightened colour reads greyer than its numbers suggest. Adding 5–10% saturation alongside every 20% of lightness keeps the ramp looking like one hue rather than a fade to grey.

Frequently Asked Questions

What is gray in HEX?

#808080 is medium gray, the exact midpoint between black and white.

Gray vs grey spelling?

Gray is American English, grey is British English. Both are correct; CSS uses "gray".

What gray is best for text?

For body text on white, use #374151 to #1F2937 for good readability and WCAG compliance.

Related Tools

Explore other tools you might find useful:

More Color Converter (HEX, RGB, HSL) tools

You might also need