Midnight Blue Color Code: Hex #191970
The hex code for Midnight Blue is #191970 (the CSS keyword midnightblue). Midnight Blue RGB code: rgb(25, 25, 112). The xkcd color survey gives #020035 instead, which looks clearly different; both codes are below with their source.
#191970Top: the code browsers use#020035Below: compare edge to edgeMidnight Blue color codes: each Midnight Blue hex code in every format
Sources
Properties
- Hex codes
- 2 different ones in 3 color lists; they look clearly different
- Family
- blue
- Contrast
- 14.85:1 with white, 1.41:1 with black
- CSS keyword
- midnightblue
- Character
- very dark, moderately saturated
- Readable text on it
- white (AA)
In the X11 set it shares hue and lightness with dark blue and differs only in saturation, 64% against 100%.
A very dark, moderately saturated violet with a cool cast. In code, midnightblue gives exactly this web value. If you mean the color as people usually picture the name, the survey value #020035 is closer: it is darker and more muted.
White text reads best on it; black text does not pass WCAG AA. Its exact opposite on the color wheel cannot be shown on screens, so the complementary palette uses the closest displayable version. Even pale tints keep its hue, which makes it easy to use for soft backgrounds. Next to Navy, its closest named neighbour, it looks about as light, more muted and warmer; beside Dark Blue it looks about as light, more muted and warmer. It is one of the darkest of the blue family here.
Colors that go with Midnight Blue
Complementary: the opposite of Midnight Blue
#191970White text 14.85:1#352A00White text 14.16:1#7380B3Black text 5.47:1#1D1600White text 17.99:1
Analogous
#002E4AWhite text 14.10:1#191970White text 14.85:1#3A0663White text 15.15:1#97A1C8Black text 8.25:1
Triadic
#191970White text 14.85:1#540A00White text 14.78:1#003518White text 13.79:1#BDC4DDBlack text 12.10:1
Monochrome
#02021AWhite text 20.46:1#0B0B43White text 18.37:1#191970White text 14.85:1#515F9DWhite text 6.05:1#97A1C8Black text 8.25:1
With neutrals
#191970White text 14.85:1#BDC4DDBlack text 12.10:1#010108White text 20.81:1#5C647EWhite text 5.87:1
Preview
Heading on Midnight Blue
Body text on this color, 14.85:1.
ButtonHeading in Midnight Blue
Text in this color on white, 14.85:1.
ButtonTints and shades
#BDC4DD#97A1C8#7380B3#515F9D#323E87#191970#121259#0B0B43#05052E#02021A#010108
WhiteMidnight BlueBlack
Similar named colors
Where the name comes from
- Source: Wikipedia, “X11 color names” (checked 1 Nov 2026)
- Listed in CSS Color 4, xkcd color survey, meodai color-name-list. About these lists.
Try it: