100% free no uploads no sign-up

blue color code

The hex code for blue is #0000FF, which is rgb(0, 0, 255) in RGB and cmyk(100%, 100%, 0%, 0%) in CMYK. It's a medium, vivid blue. It is a built-in CSS colour, so you can also write it as “blue”.

#0000FFblue
White text: 8.59:1 ✓ AABlack text: 2.44:1 ✗Nearest name: blue

Move the sliders to find a lighter, darker or softer blue; the codes update as you go.

Blue colour codes

HEX#0000FF
RGBrgb(0, 0, 255)
HSLhsl(240, 100%, 50%)
HSV / HSBhsv(240, 100%, 100%)
CMYKcmyk(100%, 100%, 0%, 0%)
Decimal255
CSS keywordblue

About blue

Blue sits at a hue of 240° on the colour wheel, with 100% saturation and 50% lightness. That makes it a cool colour: cool colours feel calm and steady and appear to recede, so they work well for large areas.

For text, white reads better on blue. Blue as text on a white background has a contrast ratio of 8.59:1, which passes the WCAG AA rule for body text (4.5:1). On black it is 2.44:1, which fails AA for body text.

Tints and shades of blue

Tints mix blue with white and shades mix it with black, in 10% steps. They're the easiest way to get lighter backgrounds and darker hover or text colours that still match.

#E6E6FF#CCCCFF#B3B3FF#9999FF#8080FF#6666FF#4D4DFF#3333FF#1A1AFF
blue #0000FF
#0000E6#0000CC#0000B3#000099#000080#000066#00004D#000033#00001A

Colours that go with blue

Complementary — opposite on the colour wheel: maximum contrast

#0000FF#FFFF00

Analogous — neighbours 30° either side: calm and natural

#0080FF#0000FF#8000FF

Triadic — three hues 120° apart: lively but balanced

#0000FF#FF0000#00FF00

Split complementary — the two neighbours of the complement: contrast with less tension

#0000FF#FF8000#80FF00

Tetradic — four hues 90° apart: rich, use one as the main colour

#0000FF#FF0080#FFFF00#00FF80

Blue text contrast

CombinationRatioAA normal (4.5:1)AA large (3:1)AAA (7:1)
blue on white8.59:1passpasspass
blue on black2.44:1failfailfail

Check blue against any other colour in the contrast checker.

How blue looks with colour blindness

Simulated with the Machado et al. (2009) model for the complete loss of one type of cone cell. Colour vision deficiency affects roughly 1 in 12 men and 1 in 200 women, most often as red-green colour blindness.

normal #0000FFprotanopia #005CFFdeuteranopia #003DFBtritanopia #006B96

Use blue in code

.blue {
  color: blue;
  background-color: #0000ff;
  border-color: rgb(0, 0, 255);
}

Frequently asked questions

What is the hex code for blue?

Blue is #0000FF (lowercase #0000ff). It's the official value of the CSS keyword “blue”.

What is blue in RGB, HSL and CMYK?

RGB: rgb(0, 0, 255). HSL: hsl(240, 100%, 50%). CMYK: cmyk(100%, 100%, 0%, 0%). CMYK is a simple conversion for reference; for professional printing, ask your printer for a matching ink or Pantone swatch.

What colours go with blue?

Its complementary colour is #FFFF00 (close to yellow), which gives the strongest contrast. For a calmer look, use the analogous colours #0080FF and #8000FF, or the triadic pair #FF0000 and #00FF00. Tints and shades of blue itself always work together.

Is blue a warm or cool colour?

Blue has a hue of 240°, which makes it cool.

Should I use black or white text on blue?

White. Black text on blue has a contrast ratio of 2.44:1 and white text has 8.59:1. WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.

How do I use blue in CSS?

Write color: blue; or color: #0000ff; — both give the same colour. Named colours work in every browser.

Colours similar to blue