RGB to HEX: #FF00FF

Also known as: CSS fuchsia, CSS magenta

Result

rgb(255 0 255) → #FF00FF

Values are shown at full precision, so converting back gives exactly #ff00ff. 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 = 255 = 15×16 + 15 → FF
    G = 0 = 0×16 + 0 → 00
    B = 255 = 15×16 + 15 → FF
  2. 2. pairs → HEX

    FF 00 FF → #FF00FF

All formats

HEX
#ff00ff
RGB
rgb(255 0 255)
RGB (legacy)
rgb(255, 0, 255)
HSL
hsl(300.00 100.00% 50.00%) → hsl(300 100% 50%)
HWB
hwb(300 0% 0%)
OKLCH
oklch(0.702 0.322 328.4) · oklch(70.2% 0.322 328.4)
OKLab
oklab(0.702 0.275 -0.169)
Lab (D50)
lab(60.17 93.54 -60.50)
LCH (D50)
lch(60.17 111.40 327.11)
Display P3
color(display-p3 0.9175 0.2003 0.9675)
Linear sRGB
color(srgb-linear 1.0000 0.0000 1.0000)

Gamut: sRGB and Display P3

#FF00FF is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.322 and Display P3 reaches 0.352; this color uses 100% of the sRGB chroma available.

CSS snippets

.element {
  color: #ff00ff;
  color: rgb(255 0 255);
  color: hsl(300 100% 50%);
  color: oklch(0.702 0.322 328.4);
}

/* Tailwind CSS v4 */
@theme {
  --color-brand: oklch(0.702 0.322 328.4);
}
/* arbitrary values */
class="text-[#ff00ff] bg-[oklch(0.702_0.322_328.4)]"

/* wide-gamut screens */
@media (color-gamut: p3) {
  .element { color: color(display-p3 0.9175 0.2003 0.9675); }
}

/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #ff00ff 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

  • #FF38FF · oklch(0.762 0.322 328.4) · ΔL +0.06
  • #E900EA · oklch(0.642 0.322 328.4) · ΔL −0.06

Open in the studio

Other converters for this color

All converters →

Guides: What is OKLCH?