How to convert a color
- Type or paste a color into the box, or click the color picker to choose one visually.
- All formats appear in the table: HEX, RGB, HSL, HSV and CMYK. Click Copy next to the one you need.
- Check the contrast panel to see whether text in this color is readable on white or black backgrounds.
- Use the tints and shades row to find lighter and darker versions for hover states, borders and backgrounds.
Accepted input: #rgb, #rrggbb, #rrggbbaa, rgb()/rgba() with commas or spaces, hsl(), hsv(), cmyk(), three plain numbers like 59, 130, 246, and all 148 CSS color names.
Color formats explained
| Format | What it describes | Where it's used |
|---|---|---|
| HEX | Red, green and blue as two hex digits each (00–FF) | CSS, design tools, brand guidelines |
| RGB | Red, green, blue from 0 to 255 | CSS, programming, screens |
| HSL | Hue (0–360°), saturation and lightness (%) | CSS; easy to make lighter or darker variants |
| HSV / HSB | Hue, saturation and value (brightness) | Color pickers in Photoshop, Figma and others |
| CMYK | Cyan, magenta, yellow and black ink (%) | Print design |
About CMYK: the values here are a simple mathematical conversion, without a printer color profile. Real print results depend on the paper, ink and the ICC profile your printer uses, and many bright screen colors can't be printed exactly. For brand-critical print work, convert in your design software with the profile your printer supplies, or use a Pantone guide.
Contrast and accessibility
The Web Content Accessibility Guidelines (WCAG 2.x) define a contrast ratio between text and its background, from 1:1 (identical) to 21:1 (black on white). To meet level AA, normal text needs at least 4.5:1 and large text (24 px, or 19 px bold) at least 3:1. Level AAA requires 7:1 and 4.5:1. Buttons, icons and form borders need 3:1.
The swatch shows your color with white or black text — whichever contrasts more — and the table shows the ratio against both, so you can quickly decide which text color to put on a colored button.
Frequently asked questions
How do I convert HEX to RGB?
Split the six hex digits into three pairs and convert each from base 16 to base 10. For #4338CA: 43 → 67, 38 → 56, CA → 202, so rgb(67, 56, 202). Paste the HEX code above to get it instantly.
What is the difference between HSL and HSV?
Both use hue and saturation, but HSL’s lightness runs from black (0%) through the pure color (50%) to white (100%), while HSV’s value runs from black (0%) to the pure color (100%). Design-tool pickers usually use HSV/HSB; CSS uses HSL.
Are the CMYK values accurate for printing?
They are a standard formula without a color profile, good as a starting point. For exact print colors use your printer’s ICC profile in design software, because real ink behaves differently on different papers.
What does the alpha value do?
Alpha is opacity, from 0 (transparent) to 1 (opaque). It’s written as the last two digits of an 8-digit HEX code (#4338ca80 is about 50%) or the fourth value in rgba() and hsla().