Navy blue hex code

The hex code for navy blue is #000080, or rgb(0, 0, 128). In CSS it is the named color navy.

#000080
HEX#000080
RGBrgb(0, 0, 128)
HSLhsl(240, 100%, 25%)
HSV / HSBhsv(240, 100%, 50%)
OKLCHoklch(27.11% 0.1879 264.05)
CMYKcmyk(100%, 100%, 0%, 50%)
HEX, 50% opacity#00008080
RGB, 50% opacityrgb(0 0 128 / 50%)
CSS namenavy
Defined inHTML 4.01 (one of the original 16 color names)

About navy blue

In CSS, navy blue is called navy (#000080): blue at about half strength with no red or green. It is one of the 16 HTML 4 color names.

Related dark blues are darkblue (#00008B), midnightblue (#191970) and mediumblue (#0000CD).

Tints of navy blue

Navy blue is darker than a usual 950 step, so it ends the scale and every other step is lighter and brighter. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For navy blue mixed with white, black or gray in even steps, use the tint and shade generator.

50#EEF8FF100#E0EFFF200#C8DFFF300#A6C8FF400#7BA9FF500#5D93FF600#2D6BFF700#023FFF800#002FE3900#0732B2950#000080

Colors that go with navy blue

Partner hues are picked on the OKLCH color wheel at a mid lightness, because navy blue itself is very dark.

Complementary: the opposite hue

#000080#835B00

Open in the palette generator · Compare the screen and painter's complements of navy blue

Analogous: neighboring hues 30° either side

#000080#006DA1#6D42C1

Open in the palette generator · See analogous and monochromatic colors of navy blue on three wheels

Triadic: three hues 120° apart

#000080#B61A28#007C00

Open in the palette generator

Split complementary: the two hues beside the complement

#000080#A04400#636A00

Open in the palette generator

Text on navy blue

White text on navy blue: 16.01:1
TextRatioAA normalAA largeAAA normal
White16.01:1PassPassPass
Black1.31:1FailFailFail

The ratio is the same either way round, so navy blue text on a white background is also 16.01:1. Check other pairs in the color contrast checker.

Similar named colors

The CSS named colors closest to navy blue, by deltaE OK distance.

darkblue #00008Bmidnightblue #191970mediumblue #0000CDindigo #4B0082darkslateblue #483D8Brebeccapurple #663399

See all 148 on the color names page.

Closest Tailwind CSS colors

violet-950 v4: violet-950, #2F0D68, deltaE OK 0.090

violet-950 v3: violet-950, #2E1065, deltaE OK 0.092

No default Tailwind color is a close match: the nearest are violet-950 in v4 and violet-950 in v3. Use an arbitrary value instead: bg-[#000080]. A deltaE OK of around 0.02 is roughly the smallest difference most people notice side by side. Browse every shade on the Tailwind CSS colors page.

Navy blue with color vision deficiency

An approximation of how navy blue may look with protanopia, deuteranopia and tritanopia (simulated with Machado, Oliveira and Fernandes, 2009), and with achromatopsia, shown as a gray of the same luminance.

protanopia #002883deuteranopia #001A7Etritanopia #003248achromatopsia #212121

Test a whole palette or image in the color blindness simulator.

Using navy blue in code

.example {
  color: navy;                 /* named color */
  background-color: #000080;  /* hex */
  border-color: rgb(0, 0, 128);
}

Frequently asked questions

What is the hex code for navy blue?
In CSS, navy blue is the named color navy, hex code #000080. You can use either in a stylesheet.
What is navy blue in RGB?
rgb(0, 0, 128). In HSL it is hsl(240, 100%, 25%), and in OKLCH oklch(27.11% 0.1879 264.05).
What text color goes on navy blue?
White text has the higher contrast on #000080: 16.01:1, which meets AAA for all text. Black text reaches 1.31:1.
What is the closest Tailwind color to navy blue?
No default Tailwind color is a close match: the nearest are violet-950 in v4 and violet-950 in v3. Use an arbitrary value instead: bg-[#000080].
How do I make navy blue transparent?
Add an alpha value. Half-transparent navy blue is #00008080 as 8-digit HEX (80 is 128 out of 255) or rgb(0 0 128 / 50%).