RGB to HEX: #4169E1

Also known as: CSS royalblue

Result

rgb(65 105 225) → #4169E1

Values are shown at full precision, so converting back gives exactly #4169e1. The rounded form is what you normally paste into CSS.

Step-by-step math

Every number below is computed from the input, nothing is looked up.

  1. 1. base 10 → base 16

    R = 65 = 4×16 + 1 → 41
    G = 105 = 6×16 + 9 → 69
    B = 225 = 14×16 + 1 → E1
  2. 2. pairs → HEX

    41 69 E1 → #4169E1

All formats

HEX
#4169e1
RGB
rgb(65 105 225)
RGB (legacy)
rgb(65, 105, 225)
HSL
hsl(225.00 72.73% 56.86%) → hsl(225 73% 57%)
HWB
hwb(225 25% 12%)
OKLCH
oklch(0.560 0.188 266.4) · oklch(56.0% 0.188 266.4)
OKLab
oklab(0.560 -0.012 -0.188)
Lab (D50)
lab(46.80 17.78 -66.66)
LCH (D50)
lch(46.80 68.99 284.94)
Display P3
color(display-p3 0.2904 0.4077 0.8525)
Linear sRGB
color(srgb-linear 0.0529 0.1413 0.7529)

Gamut: sRGB and Display P3

#4169E1 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.242 and Display P3 reaches 0.259; this color uses 78% of the sRGB chroma available.

CSS snippets

.element {
  color: #4169e1;
  color: rgb(65 105 225);
  color: hsl(225 73% 57%);
  color: oklch(0.560 0.188 266.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.560 0.188 266.4);
}
/* arbitrary values */
class="text-[#4169e1] bg-[oklch(0.560_0.188_266.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.2904 0.4077 0.8525); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #4169e1 calc(l - 0.1) c h); }

Nearby colors

Closest colors in the Tailwind and CSS named palettes (OKLab distance).

Lighter and darker, same hue and chroma

  • #517CF6 · oklch(0.620 0.188 266.4) · ΔL +0.06
  • #3156CC · oklch(0.500 0.188 266.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?