Skip to content
Let’s chat ↗

THE COLOR LIBRARY / Cool

Navy color codes.

The CSS navy color code is #000080. Its RGB value is rgb(0, 0, 128) and its HSL value is hsl(240, 100%, 25.1%). Start with the exact reference, then choose a shade for the job.

A color name describes a family in everyday language. This page uses the standardized CSS keyword as its reference; your brand’s navy may be different.

Explore the shades ↓
CSS / navyNavy#000080

COPY. PASTE. MAKE IT YOURS.

Navy in HEX, RGB, and HSL

HEX#000080
RGBrgb(0, 0, 128)
HSLhsl(240, 100%, 25.1%)

HEX and RGB encode the same sRGB reference. HSL is calculated from it and rounded to two decimals for display. These are screen color values, not a CMYK print specification.

ONE COLOR. DIFFERENT ROLES.

Explore navy tints and shades

Select a swatch to see its codes and compare text contrast.

UI COLOR SPECIMEN

Make the next step clear.

A label, a surface, and room to breathe.

Selected: Reference

Selected color

Reference · #000080

rgb(0, 0, 128)hsl(240, 100%, 25.1%)

The specimen picks whichever of black or white has higher contrast. It demonstrates a pair, not a complete accessible component.

Illustrative scale: tints mix the reference with white, shades with black, by the stated percentage in encoded sRGB channels. This is not a perceptually uniform scale. Black tints and white shades remain useful; mixing black with black or white with white repeats the reference.

Text contrast on navy

The table follows your selected swatch, currently #000080. Decisions use the full calculated ratio; displayed ratios are rounded.

Text against the selected navy surface
Text colorRatioAA ordinary textAA large text
Black #0000001.31:1Fail · 4.5:1Fail · 3:1
White #FFFFFF16.01:1Pass · 4.5:1Pass · 3:1

Large text is at least 18pt, or 14pt bold. These numeric checks apply to opaque, solid color pairs. Other criteria, states, backgrounds, and exceptions need review. Read W3C’s contrast guidance.

Navy on black has low contrast despite belonging to a different hue family. Dark themes need lighter foreground roles instead of simply reusing light-theme navy text.

Check a custom color pair ↗

IN A REAL INTERFACE

How to use navy in product design

Give it one clear role

Navy is a dark blue suitable for a strong heading, navigation surface, or restrained action treatment. It can sit near black visually, so compare hierarchy at the real text size.

A UI example to try

A navy sidebar can hold pale labels and a clearly marked current section. Test the active item, dividers, icons, and keyboard focus against the sidebar background individually.

Work through a real screen

Use navy on a navigation region beside the main content surface. Check ordinary labels, selected items, icons, and focus treatment together. A very dark surface can make a bright accent feel stronger than it does on a light page, so review the entire navigation state instead of approving the background alone.

Compare nearby colors by purpose

Compare navy with black for a dark neutral treatment and blue for more visible chromatic emphasis. Keep a separate semantic role for navigation surfaces so changing the brand blue does not unexpectedly recolor the whole application shell.

  1. Choose the role. Decide whether navy is a surface, foreground, accent, or status. Name the semantic token after that purpose.
  2. Test the actual pair. Compare its foreground and background at the intended size. Test hover, selected, focus, and supported themes independently.
  3. Document the decision. Keep the approved code, usage rule, and contrasting companion together. Preserve labels and non-color cues when communicating a state.

Copy a navy CSS palette

These numeric names are illustrative palette tokens, not a standard scale. Connect approved values to semantic tokens such as --surface-highlight or --text-primary after testing their pairs.

:root {
  --navy-100: #CCCCE6;
  --navy-300: #6666B3;
  --navy-500: #000080;
  --navy-700: #000060;
  --navy-900: #000040;
}
Download CSS palette ↓

Turn palette values into semantic tokens ↗

Common questions about navy

What is the HEX code for navy?

The CSS named color navy is #000080. Use that exact value when you want the standardized reference; use your own documented token when you mean a particular brand shade.

Is navy accessible?

A color by itself cannot pass or fail accessibility. The foreground/background pair, content size, interaction state, and meaning all matter. Use the table above for the selected solid-color pair, then review the complete interface.

Explore related colors