RGB to HEX: #A855F7
Also known as: Tailwind v3 purple-500
Result
rgb(168 85 247) → #A855F7
Values are shown at full precision, so converting back gives exactly #a855f7. 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. base 10 → base 16
R = 168 = 10×16 + 8 → A8 G = 85 = 5×16 + 5 → 55 B = 247 = 15×16 + 7 → F7
2. pairs → HEX
A8 55 F7 → #A855F7
All formats
- HEX
- #a855f7
- RGB
- rgb(168 85 247)
- RGB (legacy)
- rgb(168, 85, 247)
- HSL
- hsl(270.74 91.01% 65.10%) → hsl(271 91% 65%)
- HWB
- hwb(271 33% 3%)
- OKLCH
- oklch(0.627 0.233 303.9) · oklch(62.7% 0.233 303.9)
- OKLab
- oklab(0.627 0.130 -0.193)
- Lab (D50)
- lab(52.80 56.27 -68.75)
- LCH (D50)
- lch(52.80 88.85 309.30)
- Display P3
- color(display-p3 0.6165 0.3506 0.9358)
- Linear sRGB
- color(srgb-linear 0.3916 0.0908 0.9301)
Gamut: sRGB and Display P3
#A855F7 is a hex color, so it sits inside sRGB and therefore inside Display P3. At this lightness and hue, sRGB reaches chroma 0.250 and Display P3 reaches 0.271; this color uses 93% of the sRGB chroma available.
CSS snippets
.element {
color: #a855f7;
color: rgb(168 85 247);
color: hsl(271 91% 65%);
color: oklch(0.627 0.233 303.9);
}
/* Tailwind CSS v4 */
@theme {
--color-brand: oklch(0.627 0.233 303.9);
}
/* arbitrary values */
class="text-[#a855f7] bg-[oklch(0.627_0.233_303.9)]"
/* wide-gamut screens */
@media (color-gamut: p3) {
.element { color: color(display-p3 0.6165 0.3506 0.9358); }
}
/* relative color syntax: 10% darker */
.element-dark { color: oklch(from #a855f7 calc(l - 0.1) c h); }Nearby colors
Closest colors in the Tailwind and CSS named palettes (OKLab distance).
- purple-500#AD46FF
- violet-500#8E51FF
- v3 violet-500#8B5CF6
- mediumorchid#BA55D3
- v3 purple-600#9333EA
- mediumpurple#9370DB
- mediumslateblue#7B68EE
- purple-600#9810FA
Lighter and darker, same hue and chroma
- #BB69FF · oklch(0.687 0.233 303.9) · ΔL +0.06
- #9640E2 · oklch(0.567 0.233 303.9) · ΔL −0.06
Open in the studio
Other converters for this color
Guides: What is OKLCH?