Blue hex code

The hex code for blue is #0000FF, or rgb(0, 0, 255). CSS also accepts the keyword blue.

#0000FF
HEX#0000FF
RGBrgb(0, 0, 255)
HSLhsl(240, 100%, 50%)
HSV / HSBhsv(240, 100%, 100%)
OKLCHoklch(45.2% 0.3132 264.05)
CMYKcmyk(100%, 100%, 0%, 0%)
Short HEX#00F
HEX, 50% opacity#0000FF80
RGB, 50% opacityrgb(0 0 255 / 50%)
CSS nameblue
Defined inHTML 4.01 (one of the original 16 color names)

About blue

blue (#0000FF) is pure blue, with only the blue channel switched on. It is one of the 16 HTML 4 color names.

Because the eye is much less sensitive to blue light than to green, pure blue is a very dark color in terms of luminance, so white text on it has high contrast. Softer blues in CSS include royalblue (#4169E1), dodgerblue (#1E90FF) and cornflowerblue (#6495ED).

Shades and tints of blue

Blue lands on the 800 step. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For blue mixed with white, black or gray in even steps, use the tint and shade generator.

50#EEF8FF100#E0EFFF200#C8DFFF300#A6C8FF400#7BA9FF500#5D93FF600#2D6BFF700#023FFF800#0000FF900#0732B2950#041D6B

Colors that go with blue

Partner hues are picked on the OKLCH color wheel at a mid lightness, because blue itself is very dark.

Complementary: the opposite hue

#0000FF#835B00

Open in the palette generator · Compare the screen and painter's complements of blue

Analogous: neighboring hues 30° either side

#0000FF#006DA1#7900F6

Open in the palette generator · See analogous and monochromatic colors of blue on three wheels

Triadic: three hues 120° apart

#0000FF#C20016#007C00

Open in the palette generator

Split complementary: the two hues beside the complement

#0000FF#A04400#636A00

Open in the palette generator

Text on blue

White text on blue: 8.59:1
Black text on blue: 2.44:1
TextRatioAA normalAA largeAAA normal
White8.59:1PassPassPass
Black2.44:1FailFailFail

The ratio is the same either way round, so blue text on a white background is also 8.59:1. Check other pairs in the color contrast checker.

Similar named colors

The CSS named colors closest to blue, by deltaE OK distance.

mediumblue #0000CDroyalblue #4169E1slateblue #6A5ACDdarkblue #00008Bdarkslateblue #483D8Bblueviolet #8A2BE2

See all 148 on the color names page.

Closest Tailwind CSS colors

blue-700 v4: blue-700, #1447E6, deltaE OK 0.079

blue-700 v3: blue-700, #1D4ED8, deltaE OK 0.103

No default Tailwind color is a close match: the nearest are blue-700 in v4 and blue-700 in v3. Use an arbitrary value instead: bg-[#0000ff]. A deltaE OK of around 0.02 is roughly the smallest difference most people notice side by side. Browse every shade on the Tailwind CSS colors page.

Blue with color vision deficiency

An approximation of how blue may look with protanopia, deuteranopia and tritanopia (simulated with Machado, Oliveira and Fernandes, 2009), and with achromatopsia, shown as a gray of the same luminance.

protanopia #0059FFdeuteranopia #003DFBtritanopia #006B96achromatopsia #4C4C4C

Test a whole palette or image in the color blindness simulator.

Using blue in code

.example {
  color: blue;                 /* named color */
  background-color: #0000ff;  /* hex */
  border-color: rgb(0, 0, 255);
}

Frequently asked questions

What is the hex code for blue?
#0000FF, or #00F in short form. CSS also accepts the keyword blue, which means the same color.
What is blue in RGB?
rgb(0, 0, 255). In HSL it is hsl(240, 100%, 50%), and in OKLCH oklch(45.2% 0.3132 264.05).
What text color goes on blue?
White text has the higher contrast on #0000FF: 8.59:1, which meets AAA for all text. Black text reaches 2.44:1.
What is the closest Tailwind color to blue?
No default Tailwind color is a close match: the nearest are blue-700 in v4 and blue-700 in v3. Use an arbitrary value instead: bg-[#0000ff].
How do I make blue transparent?
Add an alpha value. Half-transparent blue is #0000FF80 as 8-digit HEX (80 is 128 out of 255) or rgb(0 0 255 / 50%).