Blue Hex Code #0000FF
Blue is a dark, vivid color with the hex code #0000FF. In RGB it is 0, 0, 255, and in HSL it is 240°, 100%, 50%. It is one of the 148 named colors in CSS, so you can write “blue” instead of the hex code.
- HEX
- #0000FF
- RGB
- rgb(0, 0, 255)
- HSL
- hsl(240, 100%, 50%)
- HSV
- hsv(240°, 100%, 100%)
- CMYK
- cmyk(100%, 100%, 0%, 0%)
- CSS name
- blue
CMYK is a simple screen-to-print estimate. Real print results depend on the printer and paper.
About Blue
On a white background Blue has a contrast ratio of 8.59:1 (AAA), and on black 2.44:1 (Fail). White text is the better choice on top of it.
It sits on the cool side of the color wheel, a range that tends to feel calm and appears to recede.
Blue is the most common color in interfaces. It signals trust and calm, which is why banks, software and healthcare brands favour it.
Good to know: Blue (#0000ff) is the blue channel at full intensity. It is the darkest of the three pure primaries, with a relative luminance of only about 7%, so it is hard to read as text on dark backgrounds. Brighter blues such as dodgerblue (#1e90ff) are easier to see.
Shades and tints of Blue
Tints mix Blue with white and shades mix it with black, in steps of 20%. Select a swatch to copy its hex code.
Color harmonies for Blue
These schemes are calculated from Blue on the RGB (screen) color wheel. Select a swatch to copy it, or open any scheme in the color wheel to adjust it.
On the artist’s RYB wheel, the complement of Blue is #FFA600, close to the named color Orange.
Blue contrast and accessibility
WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (AA), and 7:1 and 4.5:1 for AAA. This is how Blue scores against white and black.
| Against | Ratio | AA normal | AA large | AAA normal | AAA large |
|---|---|---|---|---|---|
| White (#ffffff) | 8.59:1 | ✓ Pass | ✓ Pass | ✓ Pass | ✓ Pass |
| Black (#000000) | 2.44:1 | ✕ Fail | ✕ Fail | ✕ Fail | ✕ Fail |
Blue and color blindness
These are approximate previews of how Blue can look with the main types of color vision deficiency.
Blue changes noticeably.
Blue changes noticeably.
Blue changes noticeably.
Blue changes noticeably.
Gradients with Blue
Three ready-made starting points. Copy the CSS, or open one in the generator to edit the stops and check contrast.
Blue to a lighter tint
background: linear-gradient(135deg, #0000ff 0%, #9999ff 100%); Blue to its analogous neighbour
background: linear-gradient(135deg, #0000ff 0%, #8000ff 100%); Blue to its complement
background: linear-gradient(135deg, #0000ff 0%, #ffff00 100%); Colors similar to Blue
How each close match differs from Blue.
- Medium Blue #0000CD Slightly darker, more muted.
- Blue Violet #8A2BE2 Slightly lighter, more muted, leans more violet.
- Dark Violet #9400D3 Slightly lighter, more muted, leans more violet.
- Dark Orchid #9932CC Slightly lighter, more muted, leans more violet.
- Dark Blue #00008B Darker, more muted.
- Navy #000080 Darker, more muted.
Use Blue in code
.element {
color: #0000ff;
background-color: #0000ff;
border-color: blue; /* blue is a valid CSS color name */
} :root {
--color-blue: #0000ff;
} <!-- Tailwind arbitrary values -->
<div class="bg-[#0000ff] text-[#0000ff] border-[#0000ff]"></div>
/* Tailwind v4 theme color */
@theme {
--color-blue: #0000ff;
} Blue questions
What is the hex code for Blue?
The hex code for Blue is #0000FF. In RGB that is rgb(0, 0, 255), and in HSL it is hsl(240, 100%, 50%).
What is the complementary color of Blue?
On the RGB (screen) color wheel, the complement of Blue is #FFFF00, which is close to Yellow. On the artist’s RYB wheel it is #FFA600, close to Orange.
Should I use white or black text on Blue?
White text. It has a contrast ratio of 8.59:1 against Blue, which is WCAG AAA. The other option scores 2.44:1.
Is Blue accessible as a text color on white?
Yes. Blue on white scores 8.59:1, which passes WCAG AA for normal text (4.5:1) and AAA (7:1).
What are darker and lighter shades of Blue?
Mixing Blue with black gives #0000CC, #000099, #000066, #000033 (20% to 80% black). Mixing it with white gives #3333FF, #6666FF, #9999FF, #CCCCFF (20% to 80% white).