Advertisement

Color Converter

Convert colors between HEX, RGB, RGBA, HSL, HSV, and CMYK. Pick any color and instantly see all format representations with one-click copy.

Tints (lighter)
Shades (darker)
WCAG Contrast Checker
vs. White (#FFF)
vs. Black (#000)

Conversion Formulas

HEX to RGB
R = parseInt(hex[1..2], 16)
G = parseInt(hex[3..4], 16)
B = parseInt(hex[5..6], 16)
RGB to HSL
R' = R/255, G' = G/255, B' = B/255
max = max(R',G',B'), min = min(R',G',B')
L = (max + min) / 2
S = (max - min) / (1 - |2L - 1|)
H = 60 x sector based on which channel is max

Frequently Asked Questions

HSL stands for Hue, Saturation, and Lightness. Hue is the color angle (0–360°), Saturation is how vivid the color is (0–100%), and Lightness is how light or dark it is (0% = black, 50% = pure color, 100% = white). HSL is often more intuitive for designers than RGB.

CMYK stands for Cyan, Magenta, Yellow, and Key (Black). It is a subtractive color model used in color printing. Unlike RGB (which adds light), CMYK subtracts light — inks absorb certain wavelengths. Printers use CMYK inks to produce a wide range of colors on paper.

Split the hex code into three pairs: the first pair is Red, second Green, third Blue. Convert each pair from base-16 to base-10. For example, #3b82f6 → R=59 (0x3b), G=130 (0x82), B=246 (0xf6).

The WCAG (Web Content Accessibility Guidelines) contrast ratio measures the relative luminance difference between two colors. A ratio of 4.5:1 passes AA for normal text, and 7:1 passes AAA. For large text (18pt+), AA requires 3:1. Always ensure sufficient contrast for readability.

Related Calculators