100% free no uploads no sign-up

midnight blue color code

The hex code for midnight blue is #191970, which is rgb(25, 25, 112) in RGB and cmyk(78%, 78%, 0%, 56%) in CMYK. It's a dark, rich blue. It is a built-in CSS colour, so you can also write it as “midnightblue”.

#191970midnight blue
White text: 14.84:1 ✓ AABlack text: 1.41:1 ✗Nearest name: midnight blue

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

Midnight Blue colour codes

HEX#191970
RGBrgb(25, 25, 112)
HSLhsl(240, 64%, 27%)
HSV / HSBhsv(240, 78%, 44%)
CMYKcmyk(78%, 78%, 0%, 56%)
Decimal1644912
CSS keywordmidnightblue

About midnight blue

Midnight Blue sits at a hue of 240° on the colour wheel, with 64% saturation and 27% 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 midnight blue. Midnight Blue as text on a white background has a contrast ratio of 14.84:1, which passes the WCAG AA rule for body text (4.5:1). On black it is 1.41:1, which fails AA for body text.

Tints and shades of midnight blue

Tints mix midnight 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.

#E8E8F1#D1D1E2#BABAD4#A3A3C6#8C8CB8#7575A9#5E5E9B#47478D#30307E
midnight blue #191970
#171765#14145A#12124E#0F0F43#0D0D38#0A0A2D#080822#050516#03030B

Colours that go with midnight blue

Complementary — opposite on the colour wheel: maximum contrast

#191970#707019

Analogous — neighbours 30° either side: calm and natural

#194570#191970#451970

Triadic — three hues 120° apart: lively but balanced

#191970#701919#197019

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

#191970#704519#457019

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

#191970#701945#707019#197045

Midnight Blue text contrast

CombinationRatioAA normal (4.5:1)AA large (3:1)AAA (7:1)
midnight blue on white14.84:1passpasspass
midnight blue on black1.41:1failfailfail

Check midnight blue against any other colour in the contrast checker.

How midnight 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 #191970protanopia #002D73deuteranopia #00236Etritanopia #003243

Use midnight blue in code

.midnight-blue {
  color: midnightblue;
  background-color: #191970;
  border-color: rgb(25, 25, 112);
}

Frequently asked questions

What is the hex code for midnight blue?

Midnight Blue is #191970 (lowercase #191970). It's the official value of the CSS keyword “midnightblue”.

What is midnight blue in RGB, HSL and CMYK?

RGB: rgb(25, 25, 112). HSL: hsl(240, 64%, 27%). CMYK: cmyk(78%, 78%, 0%, 56%). CMYK is a simple conversion for reference; for professional printing, ask your printer for a matching ink or Pantone swatch.

What colours go with midnight blue?

Its complementary colour is #707019 (close to olive), which gives the strongest contrast. For a calmer look, use the analogous colours #194570 and #451970, or the triadic pair #701919 and #197019. Tints and shades of midnight blue itself always work together.

Is midnight blue a warm or cool colour?

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

Should I use black or white text on midnight blue?

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

How do I use midnight blue in CSS?

Write color: midnightblue; or color: #191970; — both give the same colour. Named colours work in every browser.

Colours similar to midnight blue