Toolman

Tailwind gray colours

The eleven gray shades in the default Tailwind CSS palette, with the contrast figures that decide which of them you can actually put text on.

Every gray shade

ClassHexRGBOn whiteText colourAs text
gray-50#F9FAFB249, 250, 2511.05:1black
gray-100#F3F4F6243, 244, 2461.1:1black
gray-200#E5E7EB229, 231, 2351.24:1black
gray-300#D1D5DB209, 213, 2191.47:1black
gray-400#9CA3AF156, 163, 1752.54:1black
gray-500#6B7280107, 114, 1284.83:1whiteAA
gray-600#4B556375, 85, 997.56:1whiteAA
gray-700#37415155, 65, 8110.31:1whiteAA
gray-800#1F293731, 41, 5514.68:1whiteAA
gray-900#11182717, 24, 3917.74:1whiteAA
gray-950#0307123, 7, 1820.13:1whiteAA

"On white" is the contrast ratio against a white page. "As text" is whether that ratio passes WCAG AA for normal text, which needs 4.5:1; large text needs only 3:1.

Where the scale turns over

gray-500 is the lightest shade that reaches 4.5:1 against white, so it is the first one usable for body text on a white page. It is also where a background of this hue stops taking black text and starts needing white — the two thresholds are 4.5:1 and 4.58:1, and on this scale they fall on the same step.

Using gray in Tailwind

<div class="bg-gray-500 text-white">
<p class="text-gray-500">

The text class above is the lightest gray that still passes AA on a white background.

Frequently asked questions

What is the hex code for Tailwind gray-500?

#6B7280 — RGB 107, 114, 128. Full values and contrast for #6B7280.

Which Tailwind gray shades can I use for text?

gray-500, gray-600, gray-700, gray-800, gray-900, gray-950 reach 4.5:1 against white and pass AA for normal text. Anything lighter fails, whatever it looks like on your monitor.

Should text on a gray background be black or white?

Black up to gray-400, white from gray-500 down. The two are never both comfortable: at the crossover neither reaches 4.5:1.

All Tailwind colours · Colour reference