#0000FF: pure blue color codes, contrast and shades

By TechCompare · Updated · How we check

#0000FF is rgb(0, 0, 255), the CSS color blue and the blue primary of sRGB. It's a dark color: white text scores 8.59:1, black only 2.44:1.

#0000FF

Color Codes

  • HEX#0000FF
  • RGBrgb(0, 0, 255)
  • HSLhsl(240, 100%, 50%)
  • OKLCHoklch(45.2% 0.3132 264.05)

Text on #0000FF

White Text

Aa

The quick brown fox jumps over the lazy dog.

8.59:1APCA Lc -90.7

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

Black Text

Aa

The quick brown fox jumps over the lazy dog.

2.44:1APCA Lc 18.2

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

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

#0000FF turns the blue channel all the way up and leaves red and green off. Even at full strength it's the darkest of the three primaries, at an OKLCH lightness of 45.2%, against 62.8% for pure red and 86.64% for pure green. Your eyes are least sensitive to blue, so it adds the least brightness. The cards above give its codes and test white and black text on it. Below are 4 lighter and 4 darker shades.

Shades

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

  1. #E9F6FF
  2. #AACAFF
  3. #6A9DFF
  4. #2866FF
  5. Base#0000FF
  6. #0500EE
  7. #0400D3
  8. #0400B8
  9. #03009E

Nearest Named Colors

  • CSS Name

    blue

    #0000FF

    ExactΔE OK 0.000
  • Tailwind 4

    blue-700

    oklch(48.8% 0.243 264.376)

    Not CloseΔE OK 0.079
  • Tailwind 3

    blue-700

    #1D4ED8

    Not CloseΔE OK 0.103

About #0000FF

The classic blue link isn't quite #0000FF. The HTML spec's default link color is #0000EE, a touch darker, and visited links turn #551A8B. Both pass AAA on a white page, at 9.40:1 and 11.01:1.

The trouble is dark backgrounds. Blue text on white scores 8.59:1, but blue text on black gets only 2.44:1 and fails at every size. For links in a dark theme, go two steps up the shade scale: #6A9DFF scores 7.88:1 against black.

No Tailwind color matches it. The nearest in Tailwind 4, blue-700, sits 0.079 away in OKLab, a softer blue.

Verdict

Use #0000FF for links and buttons on light backgrounds, with white labels. Keep it away from dark backgrounds as text.

For a lighter blue that still takes white text, #2866FF is the limit, at 4.74:1. The darker steps all keep white text past AAA. 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 #0000FF?
Pure blue: rgb(0, 0, 255), hsl(240, 100%, 50%) or oklch(45.2% 0.3132 264.05). The CSS name is blue, and #00F is the same color.
Is #0000FF the default link color?
Almost. Browsers follow the HTML spec, which sets unvisited links to #0000EE, a touch darker than #0000FF, and visited links to #551A8B.
Does #0000FF work on a dark background?
Not for text. It scores 2.44:1 against black and fails WCAG at every size. Use #6A9DFF from the shade scale instead, at 7.88:1.