How to convert a color
- Type or paste a color in any format, or choose one with the color picker.
- HEX, RGB, HSL, HSV/HSB and CMYK values appear instantly, together with a preview.
- Press Copy next to the format you need and paste it into your CSS, design tool or document.
You can enter #3b82f6, 3b82f6, #38f, rgb(59, 130, 246), rgb(59 130 246 / 50%), hsl(217, 91%, 60%), hsv(217, 76%, 96%), cmyk(76%, 47%, 0%, 4%), a CSS name like tomato, or just 59, 130, 246.
Color formats explained
| Format | Example | Used in |
|---|---|---|
| HEX | #3b82f6 | CSS, HTML, design tools |
| RGB | rgb(59, 130, 246) | screens, CSS, image editors |
| HSL | hsl(217, 91%, 60%) | CSS; easy to make lighter or darker shades |
| HSV / HSB | hsv(217, 76%, 96%) | Photoshop, Figma and other color pickers |
| CMYK | cmyk(76%, 47%, 0%, 4%) | printing (cyan, magenta, yellow, black) |
HEX is RGB written in base 16: each pair from 00 to FF is a value from 0 to 255. An optional fourth pair (or fourth digit in short form) is the alpha channel: #ff000080 is red at 50 % opacity.
HSL describes hue (0–360° on the color wheel), saturation and lightness. Changing only the lightness gives you consistent tints and shades for a palette.
HSV/HSB uses value (brightness) instead of lightness; it is what most graphic programs show in their color picker.
Contrast and accessibility
Under the values you see the WCAG 2 contrast ratio against white and black. For normal body text the ratio should be at least 4.5:1 (level AA) or 7:1 (AAA); large or bold text needs 3:1. Use this to decide whether white or black text reads better on a colored button or background.
About CMYK
Screens mix light (RGB), printers mix ink (CMYK). This converter uses the standard mathematical formula, which is fine for a first estimate. Exact print colors depend on the paper and the printer's ICC profile, so for brand colors ask your print shop for a profile-based value.
Everything is calculated in your browser — nothing is uploaded.
Frequently asked questions
How do I convert HEX to RGB?
A HEX code has three pairs of hexadecimal digits for red, green and blue. Convert each pair to decimal: in #3B82F6, 3B = 59, 82 = 130 and F6 = 246, so the color is rgb(59, 130, 246). Paste any HEX code above and every format is shown instantly.
Which formats can I enter?
HEX (#rgb, #rrggbb, with or without # and with optional alpha), rgb() and rgba(), hsl() and hsla(), hsv() or hsb(), cmyk(), CSS color names such as navy or tomato, or simply three numbers like 255, 128, 0. Commas and the modern space-separated CSS syntax both work.
Is the CMYK value exact for printing?
No. The tool uses the simple mathematical RGB to CMYK formula. Real print colors depend on the printer, paper and ICC color profile, so ask your print shop for a profile-based conversion when exact color matters.
What does the contrast ratio mean?
It is the WCAG 2 contrast ratio of the color against white and black text or background, from 1:1 to 21:1. Normal text needs at least 4.5:1 (AA) or 7:1 (AAA); large text needs 3:1.
Last updated: