Royal blue hex code

The hex code for royal blue is #4169E1, or rgb(65, 105, 225). CSS also accepts the keyword royalblue.

#4169E1
HEX#4169E1
RGBrgb(65, 105, 225)
HSLhsl(225, 73%, 57%)
HSV / HSBhsv(225, 71%, 88%)
OKLCHoklch(55.98% 0.1882 266.4)
CMYKcmyk(71%, 53%, 0%, 12%)
HEX, 50% opacity#4169E180
RGB, 50% opacityrgb(65 105 225 / 50%)
CSS nameroyalblue
Defined inCSS Color 3 (from the X11 color names)

About royal blue

In CSS, royal blue is royalblue (#4169E1), a bright, medium blue.

Darker blues nearby are mediumblue (#0000CD) and darkblue (#00008B), and lighter ones are cornflowerblue (#6495ED) and dodgerblue (#1E90FF).

Shades and tints of royal blue

Royal blue lands on the 600 step. The steps follow a lightness curve modeled on Tailwind CSS's default palette; build your own in the Tailwind color generator. For royal blue mixed with white, black or gray in even steps, use the tint and shade generator.

50#F3F7FF100#E5EFFF200#CADEFF300#A9C7FF400#80A8FF500#6491FF600#4169E1700#395DC9800#304DA3900#2B4282950#17264D

Colors that go with royal blue

Partner hues are picked on the OKLCH color wheel.

Complementary: the opposite hue

#4169E1#966D00

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

Analogous: neighboring hues 30° either side

#4169E1#007EBE#8254D3

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

Triadic: three hues 120° apart

#4169E1#CB3532#008F20

Open in the palette generator

Split complementary: the two hues beside the complement

#4169E1#B75500#707E00

Open in the palette generator

Text on royal blue

White text on royal blue: 4.85:1
Black text on royal blue: 4.33:1
TextRatioAA normalAA largeAAA normal
White4.85:1PassPassFail
Black4.33:1FailPassFail

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

Similar named colors

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

slateblue #6A5ACDmediumslateblue #7B68EEdodgerblue #1E90FFsteelblue #4682B4mediumpurple #9370DBcornflowerblue #6495ED

See all 148 on the color names page.

Closest Tailwind CSS colors

blue-600 v4: blue-600, #155DFC, deltaE OK 0.060

blue-600 v3: blue-600, #2563EB, deltaE OK 0.033

In Tailwind CSS v4 it is blue-600 (#155DFC), and in v3 blue-600 (#2563EB). For the exact color, use an arbitrary value such as bg-[#4169e1]. 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.

Royal blue with color vision deficiency

An approximation of how royal 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 #0879E5deuteranopia #006ADFtritanopia #00869Bachromatopsia #717171

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

Using royal blue in code

.example {
  color: royalblue;                 /* named color */
  background-color: #4169e1;  /* hex */
  border-color: rgb(65, 105, 225);
}

Frequently asked questions

What is the hex code for royal blue?
#4169E1. CSS also accepts the keyword royalblue, which means the same color.
What is royal blue in RGB?
rgb(65, 105, 225). In HSL it is hsl(225, 73%, 57%), and in OKLCH oklch(55.98% 0.1882 266.4).
What text color goes on royal blue?
White text has the higher contrast on #4169E1: 4.85:1, which meets AA for all text. Black text reaches 4.33:1.
What is the closest Tailwind color to royal blue?
In Tailwind CSS v4 it is blue-600 (#155DFC), and in v3 blue-600 (#2563EB). For the exact color, use an arbitrary value such as bg-[#4169e1].
How do I make royal blue transparent?
Add an alpha value. Half-transparent royal blue is #4169E180 as 8-digit HEX (80 is 128 out of 255) or rgb(65 105 225 / 50%).