Color Converter โ HEX, RGB, HSL, HSV, CMYK, OKLCH
Convert colors between HEX, RGB, HSL, HSV, HWB, CMYK, OKLCH and CSS color names, with a visual picker, eyedropper and WCAG contrast check. Free, runs in your browser.
How it works
- Type a HEX value such as #RGB, #RGBA, #RRGGBB, or #RRGGBBAA; rgb()/rgba() with commas or spaces and percentage channels; hsl()/hsla(); hsv()/hsb(); hwb(); cmyk(); oklch(); or any CSS color name such as rebeccapurple. Alpha is ignored. Drag the square and hue bar to pick a color. Contrast ratios are for normal text against white, black, and an optional compare color.
Same formats as the input. Empty leaves this row as a dash.
- HEX
- โ
- RGB
- โ
- HSL
- โ
- HSV
- โ
- HWB
- โ
- CMYK
- โ
- OKLCH
- โ
- CSS name
- โ
WCAG contrast
- Vs white
- โ
- Vs black
- โ
- Vs compare
- โ
About color conversion
What is a color converter?
A color converter translates the same color between common notations: HEX (#RRGGBB), RGB, and HSL. Designers and developers use it to keep CSS, design tokens, and design tools in sync.
This page also shows WCAG contrast ratios against white, black, and an optional compare color so you can check text readability. Everything runs in your browser; colors are never uploaded.
Convert colors in code
- JavaScript (CSS)
// CSS custom properties :root { --brand: #0f6e6e; } .button { color: rgb(15, 110, 110); }- Python
# Example: HEX to RGB hex_value = "0f6e6e" r, g, b = int(hex_value[0:2], 16), int(hex_value[2:4], 16), int(hex_value[4:6], 16) print(f"rgb({r}, {g}, {b})")
Color converter FAQ
- Which color formats are supported?
- HEX (#RGB, #RGBA, #RRGGBB, #RRGGBBAA), rgb()/rgba() with comma or space syntax and percentage channels, hsl()/hsla(), hsv()/hsb(), hwb(), cmyk(), oklch(), and all 148 CSS named colors. Alpha channels are accepted in input but ignored for the outputs and contrast checks.
- What do the WCAG contrast labels mean?
- AA and AAA are WCAG 2 contrast levels for normal text. This page reports the ratio against white, black, and an optional compare color so you can judge readability quickly.
- Does the eyedropper upload my screen?
- No. The EyeDropper API (when available) reads a pixel locally in the browser. Nothing is sent to a server.
- What is OKLCH and why use it in CSS?
- OKLCH describes color with perceptual lightness, chroma, and hue. Equal lightness steps look more even than in HSL, which makes it useful for palettes, themes, and accessible contrast tuning. Modern browsers support it in CSS; this tool converts it to HEX or the nearest CSS color name.
- How accurate is HEX to CMYK?
- The CMYK result uses a simple device-independent formula (cyan, magenta, yellow, and black computed from the RGB values). It is a quick reference for screen colors, not a print-ready profile. For printing, convert with an ICC-profiled tool and proof the result.