100% free no uploads no sign-up

purple color code

The hex code for purple is #800080, which is rgb(128, 0, 128) in RGB and cmyk(0%, 100%, 0%, 50%) in CMYK. It's a dark, vivid magenta. It is a built-in CSS colour, so you can also write it as “purple”.

#800080purple
White text: 9.41:1 ✓ AABlack text: 2.22:1 ✗Nearest name: purple

Move the sliders to find a lighter, darker or softer purple; the codes update as you go.

Purple colour codes

HEX#800080
RGBrgb(128, 0, 128)
HSLhsl(300, 100%, 25%)
HSV / HSBhsv(300, 100%, 50%)
CMYKcmyk(0%, 100%, 0%, 50%)
Decimal8388736
CSS keywordpurple

About purple

Purple sits at a hue of 300° on the colour wheel, with 100% saturation and 25% lightness. That makes it a colour that sits between warm and cool: greens and purples like this can be styled warm or cool depending on what you put next to them.

For text, white reads better on purple. Purple as text on a white background has a contrast ratio of 9.41:1, which passes the WCAG AA rule for body text (4.5:1). On black it is 2.22:1, which fails AA for body text.

Tints and shades of purple

Tints mix purple with white and shades mix it with black, in 10% steps. They're the easiest way to get lighter backgrounds and darker hover or text colours that still match.

#F2E6F2#E6CCE6#D9B3D9#CC99CC#C080C0#B366B3#A64DA6#993399#8D1A8D
purple #800080
#730073#660066#5A005A#4D004D#400040#330033#260026#1A001A#0D000D

Colours that go with purple

Complementary — opposite on the colour wheel: maximum contrast

#800080#008000

Analogous — neighbours 30° either side: calm and natural

#400080#800080#800040

Triadic — three hues 120° apart: lively but balanced

#800080#808000#008080

Split complementary — the two neighbours of the complement: contrast with less tension

#800080#408000#008040

Tetradic — four hues 90° apart: rich, use one as the main colour

#800080#804000#008000#004080

Purple text contrast

CombinationRatioAA normal (4.5:1)AA large (3:1)AAA (7:1)
purple on white9.41:1passpasspass
purple on black2.22:1failfailfail

Check purple against any other colour in the contrast checker.

How purple looks with colour blindness

Simulated with the Machado et al. (2009) model for the complete loss of one type of cone cell. Colour vision deficiency affects roughly 1 in 12 men and 1 in 200 women, most often as red-green colour blindness.

normal #800080protanopia #003E83deuteranopia #304B7Dtritanopia #842149

Use purple in code

.purple {
  color: purple;
  background-color: #800080;
  border-color: rgb(128, 0, 128);
}

Frequently asked questions

What is the hex code for purple?

Purple is #800080 (lowercase #800080). It's the official value of the CSS keyword “purple”.

What is purple in RGB, HSL and CMYK?

RGB: rgb(128, 0, 128). HSL: hsl(300, 100%, 25%). CMYK: cmyk(0%, 100%, 0%, 50%). CMYK is a simple conversion for reference; for professional printing, ask your printer for a matching ink or Pantone swatch.

What colours go with purple?

Its complementary colour is #008000 (close to green), which gives the strongest contrast. For a calmer look, use the analogous colours #400080 and #800040, or the triadic pair #808000 and #008080. Tints and shades of purple itself always work together.

Is purple a warm or cool colour?

Purple has a hue of 300°, which makes it neither clearly warm nor cool.

Should I use black or white text on purple?

White. Black text on purple has a contrast ratio of 2.22:1 and white text has 9.41:1. WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.

How do I use purple in CSS?

Write color: purple; or color: #800080; — both give the same colour. Named colours work in every browser.

Colours similar to purple