Color Converter — HEX ↔ RGB ↔ HSL ↔ HSV ↔ CMYK

Paste a color in any format and get every other format instantly, plus contrast ratios against black and white, a shade scale and color harmonies.

The color models explained

HEX (#58a6ff) and RGB (rgb(88, 166, 255)) describe the same thing: how much red, green and blue light to mix, each from 0 to 255. HEX is simply RGB written in hexadecimal. RGBA adds an alpha (opacity) channel.

HSL (hue, saturation, lightness) and HSV/HSB (hue, saturation, value/brightness) are cylindrical models that match how people think about color: pick a hue on the 0–360° wheel, then adjust how vivid and how light it is. HSL is what CSS uses and is ideal for generating consistent palettes — keep the hue, vary the lightness.

CMYK (cyan, magenta, yellow, key/black) is a subtractive model for print. Screen-to-print conversion is approximate because monitors and inks have different gamuts; always proof with your printer's profile.

Accessibility and contrast

WCAG 2.x requires a contrast ratio of at least 4.5:1 for normal body text and 3:1 for large text and UI components (AA level); AAA raises those to 7:1 and 4.5:1. This tool shows the ratio of your color against white and black so you can see immediately whether it works for text on a light or dark background.

Building a palette

The shades row keeps your color's hue and saturation and steps through ten fixed lightness values (5% to 95%), which is a quick way to derive hover, active, border and background variants for a design system; it does not mix the color with black or white. The palette section rotates the hue to produce complementary (180°), analogous (±30° and ±60°), triadic (±120°), tetradic, split-complementary and monochrome sets; click any swatch to make it the active color.

How to use it

  1. Enter a color as HEX (3 or 6 digits), RGB, RGBA, HSL, HSLA, HSV or CMYK, or use the native color picker.
  2. Every other representation updates live; edit any field and the rest follow.
  3. Check the contrast readouts, then click a shade or palette swatch to make it the active color.

One color, five ways

The SmartDevTools accent blue:

HEX   #58a6ff
RGB   rgb(88, 166, 255)
HSL   hsl(213, 100%, 67%)
HSV   hsv(213, 65%, 100%)
CMYK  cmyk(65%, 35%, 0%, 0%)

Its contrast against white is about 2.53:1, so it is fine for a button background with white text at large sizes, but too light for body text on a white page.

Common use cases

Input rules and a worked example

The HEX field accepts exactly 3 or 6 hex digits, with or without a leading #. Anything else, including 8-digit values with alpha, is ignored, so the other fields do not change. Set opacity with the alpha slider or in the RGBA/HSLA field instead. A shorthand such as #f63 expands to #ff6633.

Worked example: #ff6347 (tomato) reads as RGB 255, 99, 71, HSL 9, 100%, 64% and shows a contrast ratio of 2.95:1 on white and 7.13:1 on black. It fails WCAG AA for body text on white but passes AAA on black. The shade row below the swatch keeps hue and saturation and steps through ten fixed lightness values (5% to 95%); it does not mix with black or white.

Frequently asked questions

What is the difference between HSL and HSV?

Both use hue and saturation, but HSL's third axis is lightness (50% is the pure hue, 100% is white) while HSV's is value (100% is the pure hue; white requires saturation 0). CSS supports HSL natively; design tools often show HSB/HSV.

Why does the CMYK value differ from Photoshop?

CMYK depends on the ICC color profile of the target printer and paper. This tool uses a simple mathematical conversion, which is good for estimates but not for press-ready artwork.

How do I pick an accessible text color?

Aim for a contrast ratio of 4.5:1 or higher against the background. Dark text on light backgrounds usually needs lightness below ~40%; light text on dark backgrounds needs lightness above ~70%.

Does it support 8-digit HEX with alpha?

No. The HEX field accepts only 3 or 6 digits. Set opacity with the alpha slider or the RGBA/HSLA fields instead.

Why is nothing happening when I paste an 8-digit HEX colour?

The HEX field only accepts 3 or 6 digits. Remove the last two digits and set the alpha with the alpha slider or the RGBA field.

Related tools

Explore all developer tools →