Skip to main content

bg-gray-400

Tailwind Gray 400

#9CA3AF·Gray family·Shade 400

Color Values

HEX
#9CA3AF
RGB
rgb(156, 163, 175)
HSL
hsl(218, 11%, 65%)
OKLCH
oklch(0.714 0.019 261)
CMYK
cmyk(11%, 7%, 0%, 31%)
CSS Variable
var(--color-gray-400)
Tailwind Class
bg-gray-400

Accessibility Score

60/100

Good

Based on WCAG 2.1 contrast ratios against white and black backgrounds.

On White

2.54:1

Fail

On Black

8.27:1

AAA
Test in Contrast Checker →

Tailwind Usage — All Utilities

Background

bg-gray-400

Text

text-gray-400

Border

border-gray-400

Ring

ring-gray-400

Outline

outline-gray-400

Fill

fill-gray-400

Stroke

stroke-gray-400

From (gradient)

from-gray-400

Via (gradient)

via-gray-400

To (gradient)

to-gray-400

Placeholder

placeholder-gray-400

Caret

caret-gray-400

Accent

accent-gray-400

Decoration

decoration-gray-400

Shadow Color

shadow-gray-400

Tailwind v3 Config (extend custom color)

// tailwind.config.js module.exports = { theme: { extend: { colors: { 'gray-400': '#9ca3af', }, }, }, };

CSS Equivalent

/* Hex */
background-color: #9CA3AF;

/* RGB */
background-color: rgb(156, 163, 175);

/* HSL */
background-color: hsl(218, 11%, 65%);

/* OKLCH (CSS Color Level 4) */
background-color: oklch(0.714 0.019 261);

/* CSS Custom Property (Tailwind v4) */
background-color: var(--color-gray-400);

/* Gradient example */
background: linear-gradient(135deg, #f9fafb 0%, #6b7280 100%);

OKLCH — Modern Color Space

Lightness (L)

0.714

71% perceived brightness

Chroma (C)

0.019

Color intensity / saturation

Hue (H)

261°

Angle on perceptual hue wheel

oklch(0.714 0.019 261)

OKLCH is a perceptually uniform color space in CSS Color Level 4. Unlike HSL, equal steps in L produce equal perceived lightness changes — making it ideal for building accessible, harmonious design system scales.

Design Recommendations

Mid-tone accent

Shade 400 of the Gray palette

Recommended Uses

  • Icon fills on white
  • Secondary buttons (large text)
  • Chart & data visualization bars
  • Decorative UI elements

Avoid

Body text on white — often fails WCAG AA for normal text.

Preview

On White

Aa Bb Cc

On Black

Aa Bb Cc

As Background

Aa Bb Cc — #9CA3AF

Frequently Asked Questions

What is the hex code for Tailwind Gray 400?
Tailwind Gray 400 has the hex code #9CA3AF. Its RGB value is rgb(156, 163, 175) and its HSL value is hsl(218, 11%, 65%).
What Tailwind utility classes use Gray 400?
Use bg-gray-400 for backgrounds, text-gray-400 for text color, border-gray-400 for borders, and ring-gray-400 for focus rings. In Tailwind v4 the CSS variable var(--color-gray-400) is available natively.
Is Tailwind Gray 400 WCAG accessible?
Tailwind Gray 400 achieves a 2.54:1 contrast ratio on white (Fail) and 8.27:1 on black (AAA). Its overall accessibility score is 60/100 (Good).
What is the OKLCH value for Tailwind Gray 400?
Tailwind Gray 400 in OKLCH is oklch(0.714 0.019 261) — lightness 0.714, chroma 0.019, hue 261°. OKLCH is a perceptually uniform space supported natively in modern CSS via the `color()` function.
What is Tailwind Gray 400 used for?
At shade 400, Tailwind Gray 400 is best described as "Mid-tone accent". Recommended uses: Icon fills on white, Secondary buttons (large text), Chart & data visualization bars.