Color Converter (HEX, RGB, HSL)
Convert colors between HEX, RGB, HSL, HSV and CMYK. Includes a live swatch and WCAG contrast ratio. Runs entirely in your browser.
Color formats explained
HEX — hexadecimal, the most common format for web design. #4f8cff means red 4f, green 8c, blue ff.
RGB — red, green and blue on a 0–255 scale. This is how screens display color.
HSL — hue (the color itself, 0–360°), saturation (intensity, 0–100%) and lightness (0–100%). Designers prefer it because you can adjust brightness without shifting the hue.
HSV — same as HSL but uses value instead of lightness. Used by most design software.
CMYK — cyan, magenta, yellow and key (black). Printers use it because ink cannot reproduce the full brightness range of screens.
Getting the hex value right
The last two digits of a hex code are the most sensitive: #4f8cff is a vivid blue, while #4f8c (without the full pair) is a completely different color. Always write all six digits.
Accessibility
The tool reports the contrast ratio against white. Under the WCAG 2.1 guidelines:
- 4.5:1 or higher — required for normal body text
- 3:1 or higher — acceptable for large text (18pt+) and UI components
- 7:1 — the AAA standard for normal text
Related
Working with images rather than swatches? The image compressor shrinks file size for faster page loads.
Frequently asked questions
Which colour formats are supported?
HEX, RGB, HSL, HSV, CMYK and a decimal integer, plus common CSS colour names. Output includes every one of them at once.
What is the contrast ratio for?
It is the WCAG contrast ratio against white. AA requires 4.5:1 for normal text and 3:1 for large text; AAA requires 7:1.
Why does my hex colour look different on screen?
Colour management. A hex value specifies an sRGB value, and displays vary in their calibration. Always test colours on the actual target devices.
How do I get the hex value of a colour on a webpage?
Use the browser devtools colour picker, or right-click the element and inspect the computed colour. Then paste that value here to see every other format.
Does it support 8-digit hex with alpha?
Not directly, but you can convert the RGB channels and add the alpha value as a separate percentage.