Color Converter: HEX, RGB, HSL, HSV, CMYK
Enter any CSS color โ #1e90ff, rgb(30 144 255), hsl(210, 100%, 56%) or a name like dodgerblue.
Contrast (WCAG 2.x)
Tints & shades
Click a swatch to select it.
Color formats explained
| Format | Example | Notes |
|---|---|---|
| HEX | #2563eb | Red, green, blue as two hex digits each (00โff). #rgb shorthand and 8-digit #rrggbbaa with alpha also exist. |
| RGB | rgb(37 99 235) | Channels from 0 to 255. Add / 0.5 (or use rgba()) for transparency. |
| HSL | hsl(221 83% 53%) | Hue (0โ360ยฐ), saturation and lightness. Easy to create lighter/darker variants. |
| HSV / HSB | 221ยฐ, 84%, 92% | Hue, saturation, value (brightness). Used by design tools like Photoshop and Figma pickers. |
| CMYK | 84%, 58%, 0%, 8% | Cyan, magenta, yellow, key (black) for print. Converted naively; real print output depends on the color profile. |
Color contrast and accessibility
WCAG 2 requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (18.66px bold or 24px regular) to meet level AA, and 7:1 / 4.5:1 for level AAA. The checker shows how your color performs as text on white and black backgrounds.
How to convert HEX to RGB
Split the six hex digits into pairs and convert each pair from base 16 to base 10: #2563eb โ 25=37, 63=99, eb=235,
so the color is rgb(37, 99, 235). The Number Base Converter can do the hex math for you.
Frequently asked questions
Which color formats can I enter?
Any color your browser understands in CSS: HEX (3, 4, 6 or 8 digits), rgb()/rgba(), hsl()/hsla(), hwb(), and the 148 named CSS colors.
How do I convert HEX to RGB?
Split the hex code into three pairs and convert each from hexadecimal to decimal. For example, #ff8000 is rgb(255, 128, 0).
What contrast ratio do I need for accessible text?
For WCAG AA, at least 4.5:1 for normal text and 3:1 for large text. For AAA, 7:1 and 4.5:1.
Why is my CMYK value different from Photoshop?
This tool uses the simple mathematical conversion from RGB. Design apps use ICC color profiles for specific printers and papers, which produce different numbers.