' + '

Color Converter

Convert between HEX, RGB, and HSL

Color Models

Three models are in everyday use on the web:

When to Use Each Format

Alpha / Transparency

All three models support a fourth alpha channel: #818cf8cc (8-digit HEX), rgba(129, 140, 248, 0.8), or hsla(234, 89%, 74%, 0.8). The alpha value ranges from 0 (fully transparent) to 1 (fully opaque) for RGB/HSL, and from 00 to ff (hex) for the 8-digit form.

Accessibility Contrast

WCAG 2.1 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18pt or 14pt bold). You can check contrast between a foreground and background color pair using the relative luminance formula on the W3C site, or tools like the Chrome DevTools accessibility inspector.