Blue
Blue is a medium, vivid color. Hex code #0000FF.
Blue color codes
- CSS name
blue - HEX
#0000FF - RGB
rgb(0, 0, 255) - HSL
hsl(240, 100%, 50%) - OKLCH
oklch(45.2% 0.313 264.1)
HSB and CMYK values
- HSB / HSV
hsb(240, 100%, 100%) - CMYK
C100 M100 Y0 K0
White text
8.59:1 · passes WCAG AAA
Black text
2.44:1 · fails WCAG
Shades of blue
A darker shade of blue is #0008AA (700), and a lighter one is #3F77FA (400).
Colors that go with blue
Complementary
Analogous
Triadic
The complementary color of blue is #FFFF00, which is yellow.
Click a color to copy its hex code.
Colors similar to blue
- Medium blue#0000CD
Darker, more muted
- Royal blue#4169E1
Lighter, less purple, much more muted
- Slate blue#6A5ACD
Lighter, more purple, much more muted
- Dark blue#00008B
Darker, much more muted
- Dark slate blue#483D8B
Slightly darker, more purple, much more muted
- Blue violet#8A2BE2
Lighter, more purple, more muted
Each compared with blue.
About this color
Blue in CSS and design
Blue is one of the 16 basic color keywords, which come from the VGA palette by way of HTML. These four lines all give the same blue:
color: blue;
color: #0000FF;
color: rgb(0, 0, 255);
color: hsl(240, 100%, 50%);What to know about blue
CSS blue, #0000FF, is a dark color as far as contrast goes: white text on it reaches 8.59:1, black text only 2.44:1. It is not quite the blue of unvisited links, either; the HTML standard's default link color is #0000EE, with #551A8B for visited links. On a dark background, dodger blue (6.48:1 against black) or cornflower blue (7.06:1) is far easier to read.
Frequently asked questions
What is the hex code for blue?
#0000FF. In CSS you can also use the keyword blue, which works in every browser.
What is blue in RGB and HSL?
In RGB it is rgb(0, 0, 255) and in HSL hsl(240, 100%, 50%). In CMYK it is about C100 M100 Y0 K0, though printed colors vary with paper and ink.
Should I use black or white text on blue?
White text works better: it has a contrast ratio of 8.59:1 and passes WCAG AAA. Black text reaches 2.44:1.
What is the complementary color of blue?
#FFFF00, which is yellow. It sits opposite blue on the color wheel: the hue turned 180 degrees, with the same saturation and lightness.
Which colors go with blue?
For strong contrast, pair it with its complementary color #FFFF00. For a calmer look, combine it with its analogous neighbors #0080FF and #8000FF. The palette generator builds more combinations.
What color is 0000FF?
0000FF, written #0000FF in CSS, is pure blue: red 00 and green 00 are off, and blue FF is at its maximum of 255. It is the CSS keyword blue and rgb(0, 0, 255). Hex codes are not case-sensitive, and #00F is the short form of the same color.
Which blues are darker than #0000FF?
Medium blue (#0000CD), dark blue (#00008B) and navy (#000080) keep blue as the only channel and lower it step by step. Dark blue reaches 15.29:1 as text on white, against 8.59:1 for #0000FF, which makes it a good choice for body text that should still read as blue.