Web design tool

Color Converter

Convert HEX, RGB, RGBA, HSL, HSLA, HSV, HWB, CMYK, and common named colors with strict validation, live alpha preview, copy actions, and background-aware WCAG contrast.

Color input

Enter one color code

HEX · RGB · HSL · HWB

Examples: #336699CC, rgb(51 102 153 / 80%), hsl(210 50% 40%), hwb(210 20% 40%), cmyk(67%, 33%, 0%, 40%), or rebeccapurple.

Ready.

#336699rgb(51, 102, 153)

Converted values

Color code formats

HEX#336699
RGBrgb(51, 102, 153)
RGBArgba(51, 102, 153, 1)
HSLhsl(210, 50%, 40%)
HSLAhsla(210, 50%, 40%, 1)
HSVhsv(210, 66.7%, 60%)
HWBhwb(210 20% 40% / 1)
CMYKcmyk(66.7%, 33.3%, 0%, 40%)
CSS variable--color: rgba(51, 102, 153, 1);

Accessibility

Contrast checker

On white6.00:1
On black3.50:1
On custom background6.00:1
Relative luminance0.1251
Suggested textUse white text for stronger contrast.

Transparent colors are composited onto each background before the WCAG ratio is calculated.

Color codes chart

ColorNameHEXRGBHSL
Black#0000000, 0, 00, 0%, 0%
White#FFFFFF255, 255, 2550, 0%, 100%
Red#FF0000255, 0, 00, 100%, 50%
Lime#00FF000, 255, 0120, 100%, 50%
Blue#0000FF0, 0, 255240, 100%, 50%
Yellow#FFFF00255, 255, 060, 100%, 50%
Cyan#00FFFF0, 255, 255180, 100%, 50%
Magenta#FF00FF255, 0, 255300, 100%, 50%
Gray#808080128, 128, 1280, 0%, 50%

Color conversion notes

HEXHEX uses three, four, six, or eight digits; the last pair in eight-digit HEX stores alpha.
RGBRGB accepts legacy commas, modern spaces, percentages, and slash alpha, with strict channel ranges.
HSL / HSV / HWBHSL, HSV, and HWB share a hue angle but describe saturation, value, lightness, whiteness, and blackness differently.
CMYKCMYK is an RGB-derived print estimate; precise printing requires an ICC color profile.
WCAGWCAG ratios use relative luminance. Normal text needs 4.5:1 for AA and 7:1 for AAA; large text needs 3:1 for AA.

FAQ

Which color formats are supported?

HEX, RGB, RGBA, HSL, HSLA, HSV or HSB, HWB, CMYK, transparent, and common CSS color names are supported.

Can I use modern CSS color syntax?

Yes. RGB and HSL accept space-separated channels and slash alpha, including percentage RGB and angle units such as deg, rad, grad, and turn.

How is transparency handled in contrast checks?

The foreground is first composited onto white, black, or the chosen custom background, then the WCAG contrast ratio is calculated.

Is CMYK conversion exact for printing?

No. It is a practical RGB-derived estimate. Accurate print output depends on ICC profiles, ink, paper, and the printing process.