#3B82F6: Tailwind blue-500 color codes, contrast and shades

By TechCompare · Updated · How we check

#3B82F6 is rgb(59, 130, 246), the blue-500 of Tailwind CSS 2 and 3. For text on it, WCAG 2 picks black at 5.71:1, which passes AA. White gets 3.68:1, enough only for large text.

#3B82F6

Color Codes

  • HEX#3B82F6
  • RGBrgb(59, 130, 246)
  • HSLhsl(217, 91%, 60%)
  • OKLCHoklch(62.31% 0.188 259.81)

Text on #3B82F6

White Text

Aa

The quick brown fox jumps over the lazy dog.

3.68:1APCA Lc -69.4

  • AA Normal (4.5:1)Fail
  • AA Large (3:1)Pass
  • AAA Normal (7:1)Fail
  • AAA Large (4.5:1)Fail
Check White Text in Contrast Checker

Black Text

Aa

The quick brown fox jumps over the lazy dog.

5.71:1APCA Lc 40.2

  • AA Normal (4.5:1)Pass
  • AA Large (3:1)Pass
  • AAA Normal (7:1)Fail
  • AAA Large (4.5:1)Pass
Check Black Text in Contrast Checker

WCAG 2 ratios are the same whichever color is the text, so they also hold for #3B82F6 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.

#3B82F6 mixes 59 red, 130 green and 246 blue into a bright medium blue. It's blue-500 in Tailwind CSS 2 and 3, so you'll find it on a lot of buttons, links and focus rings built with Tailwind. The cards above give its codes with copy buttons and test white and black text on it. Below are four lighter and four darker shades, and the named colors that come closest.

Shades

Same hue and chroma in OKLCH, with even steps of lightness. Open any shade in the Color Picker.

  1. #E8F6FF
  2. #BBDAFF
  3. #8DBDFF
  4. #5C9FFF
  5. Base#3B82F6
  6. #2168DA
  7. #004FBF
  8. #0035A3
  9. #001789

Nearest Named Colors

  • CSS Name

    dodgerblue

    #1E90FF

    CloseΔE OK 0.036
  • Tailwind 4

    blue-500

    oklch(62.3% 0.214 259.815)

    Outside sRGB, so the closest hex is #2B7FFF

    CloseΔE OK 0.026
  • Tailwind 3

    blue-500

    #3B82F6

    ExactΔE OK 0.000

About #3B82F6

Tailwind CSS 2 shipped a new color palette with #3B82F6 as its blue-500, and Tailwind 3 kept the same value. Tailwind 3 also used it for focus rings: the plain ring class drew a see-through blue-500 unless you picked another color.

Tailwind 4 moved its colors to OKLCH, and blue-500 changed with it. Version 4 writes it as oklch(62.3% 0.214 259.815), while #3B82F6 is oklch(62.31% 0.188 259.81). The chroma went from 0.188 to 0.214, so the new blue is more vivid. That much chroma is outside sRGB, so it takes a wide gamut screen to show it in full. The closest hex is #2B7FFF. Tailwind 4 also changed the default ring color to currentColor, so focus rings in an upgraded project stop being blue unless you set a ring color.

Text on #3B82F6 is a case where the two contrast methods disagree. WCAG 2 gives black text 5.71:1 and white text 3.68:1. So black passes AA at any size, and white only passes for large text: 24px and up, or about 18.66px bold. APCA, a newer method that isn't part of any WCAG standard, reads it the other way around. White text scores Lc -69.4, and black text only Lc 40.2, under the Lc 45 APCA suggests even for large headlines.

WCAG 2.2 still decides pass or fail, so if you need white text to pass, go one step darker. Tailwind 3's blue-600, #2563EB, gives white text 5.17:1 and passes AA. So does #2168DA, the first darker step in the shade scale, at 5.18:1.

Verdict

Use #3B82F6 for fills, icons, borders and large headings, and put black text on it when the text has to pass WCAG AA. As link or body text on a white page it only reaches 3.68:1, which fails AA for normal text, so pick a darker blue there. For buttons with white labels, #2168DA or Tailwind 3's blue-600 (#2563EB) keeps the look and passes.

The shade scale keeps the OKLCH chroma and hue of #3B82F6 and moves the lightness in even steps toward white and toward black. A step sRGB can't show loses chroma until it fits, so its hue stays put. Black text passes AA on every lighter step, and white text passes on every darker one. Click a shade to open it in the Color Picker.

More Color scenarios

Hex to RGB
A hex color code is three RGB numbers written in base 16.
View details
RGB vs CMYK
Screens add light and print adds ink. See one color in both, and why a plain CMYK formula can't promise a print match.
View details
HSL color model
Hue, saturation and lightness, with three live sliders and a table of common colors in hex, RGB and HSL.
View details

Frequently asked questions

What color is #3B82F6?
A bright medium blue: rgb(59, 130, 246), hsl(217, 91%, 60%) or oklch(62.31% 0.188 259.81). It's blue-500 in Tailwind CSS 2 and 3. It has no CSS name of its own. The nearest named color is dodgerblue (#1E90FF), which sits 0.036 away in OKLab and looks a little different side by side.
Should I use white or black text on #3B82F6?
Black, if you need to pass WCAG 2. Black text gets 5.71:1 and passes AA at every size, while white text gets 3.68:1 and passes only for large text. APCA prefers white, at Lc -69.4 against Lc 40.2 for black, but it isn't part of any WCAG standard. For white text that passes, darken the blue to #2168DA or Tailwind 3's blue-600 (#2563EB).
Is #3B82F6 the same as Tailwind 4's blue-500?
No. Tailwind 4 rewrote its palette in OKLCH, and its blue-500 is oklch(62.3% 0.214 259.815). The closest hex to that is #2B7FFF, which sits 0.026 away from #3B82F6 in OKLab. To keep the old blue in Tailwind 4, add #3B82F6 as a custom color in your @theme block.
How do I use #3B82F6 with transparency?
Add two hex digits for alpha. #3B82F680 is this blue at about 50% opacity. In CSS you can also write rgb(59 130 246 / 0.5). In Tailwind, a class like bg-blue-500/50 does the same.