Purple hex code

The hex code for purple is #800080, or rgb(128, 0, 128). CSS also accepts the keyword purple.

#800080
HEX#800080
RGBrgb(128, 0, 128)
HSLhsl(300, 100%, 25%)
HSV / HSBhsv(300, 100%, 50%)
OKLCHoklch(42.09% 0.1935 328.36)
CMYKcmyk(0%, 100%, 0%, 50%)
HEX, 50% opacity#80008080
RGB, 50% opacityrgb(128 0 128 / 50%)
CSS namepurple
Defined inHTML 4.01 (one of the original 16 color names)

About purple

CSS purple (#800080) is equal parts red and blue at about half strength. It is one of the 16 HTML 4 color names.

Lighter or bluer purples in CSS include mediumpurple (#9370DB), rebeccapurple (#663399) and blueviolet (#8A2BE2), and indigo (#4B0082) is a deeper, darker one.

Shades and tints of purple

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

50#FFF2FF100#FFE4FF200#FFC6FF300#FF9BFF400#FD61FA500#F22AF1600#D100D1700#AD00AE800#8E008F900#800080950#440944

Colors that go with purple

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

Complementary: the opposite hue

#800080#007C1B

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

Analogous: neighboring hues 30° either side

#800080#743DC0#B11362

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

Triadic: three hues 120° apart

#800080#7F5E00#007383

Open in the palette generator

Split complementary: the two hues beside the complement

#800080#5D6C00#007764

Open in the palette generator

Text on purple

White text on purple: 9.42:1
Black text on purple: 2.23:1
TextRatioAA normalAA largeAAA normal
White9.42:1PassPassPass
Black2.23:1FailFailFail

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

Similar named colors

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

darkmagenta #8B008Brebeccapurple #663399indigo #4B0082darkslateblue #483D8Bdarkviolet #9400D3darkorchid #9932CC

See all 148 on the color names page.

Closest Tailwind CSS colors

fuchsia-900 v4: fuchsia-900, #721378, deltaE OK 0.032

fuchsia-800 v3: fuchsia-800, #86198F, deltaE OK 0.034

In Tailwind CSS v4 it is fuchsia-900 (#721378), and in v3 fuchsia-800 (#86198F). For the exact color, use an arbitrary value such as bg-[#800080]. 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.

Purple with color vision deficiency

An approximation of how purple 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 #003D83deuteranopia #304B7Dtritanopia #842149achromatopsia #464646

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

Using purple in code

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

Frequently asked questions

What is the hex code for purple?
#800080. CSS also accepts the keyword purple, which means the same color.
What is purple in RGB?
rgb(128, 0, 128). In HSL it is hsl(300, 100%, 25%), and in OKLCH oklch(42.09% 0.1935 328.36).
What text color goes on purple?
White text has the higher contrast on #800080: 9.42:1, which meets AAA for all text. Black text reaches 2.23:1.
What is the closest Tailwind color to purple?
In Tailwind CSS v4 it is fuchsia-900 (#721378), and in v3 fuchsia-800 (#86198F). For the exact color, use an arbitrary value such as bg-[#800080].
How do I make purple transparent?
Add an alpha value. Half-transparent purple is #80008080 as 8-digit HEX (80 is 128 out of 255) or rgb(128 0 128 / 50%).