AltUtils

Color Converter

Convert colors between HEX, RGB, HSL, HSV, CMYK and OKLCH, pick colors visually and generate shades, tints and color harmonies.

CategoryVisuals
Sheet28 / 42
ProcessingIn your browser
#3B82F6
≈ dodgerblue
100%
On white
Aa
3.68:1
AA failAAA failAA large pass
On black
Aa
5.71:1
AA passAAA failAA large pass

As a background, use black text. AA needs 4.5:1 (3:1 for large text), AAA needs 7:1.

Tints (mixed with white)
Shades (mixed with black)
Complementary
Analogous
Triadic
Split-complementary
Tetradic

Click any swatch to make it the current color.

What is the Color Converter?

The Color Converter translates a color between every format a web or print designer needs: HEX (3, 4, 6 and 8 digits), RGB and RGBA, HSL and HSLA, HSV/HSB, CMYK, the CSS Color 4 OKLCH space and the 148 CSS named colors. Every field is editable — type or paste a value into any of them (with or without the rgb()/hsl() wrapper, comma or space syntax, percentages, deg/turn hue units) and all other formats update instantly.

Values are stored internally with full floating-point precision, so switching between formats never drifts: a color copied out of any field and pasted back in maps to exactly the same 8-bit color. OKLCH colors outside the sRGB gamut are brought into range with the CSS Color 4 gamut-mapping method and flagged.

Beyond conversion you get a native color picker, an opacity slider, WCAG 2 contrast ratios against white and black, a 10%-step tint and shade scale you can copy as CSS custom properties, and complementary, analogous, triadic, split-complementary and tetradic harmonies. Everything runs locally in your browser.

Frequently asked questions

What is the difference between HEX and RGB?
They describe the same sRGB color. RGB lists red, green and blue as 0–255 numbers, while HEX writes the same three bytes in base 16 (#3B82F6 = rgb(59, 130, 246)). An optional fourth byte (#RRGGBBAA) or rgba() adds opacity.
Why use HSL or OKLCH instead of HEX?
HSL and OKLCH separate hue from lightness and saturation/chroma, so building hover states or themes is a matter of changing one number. OKLCH is perceptually uniform: two colors with the same L really look equally light, which HSL cannot guarantee. All modern browsers support oklch() in CSS.
Is the CMYK value print-accurate?
No. Without an ICC color profile any RGB-to-CMYK conversion is an approximation. The formula used here is the standard device-independent one; for professional print work, convert with your printer's profile in a tool like Photoshop or Affinity.
Can I convert transparency (alpha)?
Yes. Alpha is read from 4- and 8-digit HEX, rgba(), hsla(), oklch(… / a) and the opacity slider, and written back to HEX8, rgba, hsla and oklch. HSV and CMYK have no alpha channel, so they show only the color part.
How is the WCAG contrast ratio calculated?
Using the WCAG 2 relative-luminance formula. Translucent colors are first blended over the white or black background. Normal text needs 4.5:1 for AA and 7:1 for AAA; large text (24px, or 18.66px bold) needs 3:1 for AA.
How do tints, shades and harmonies work?
Tints mix the color with white and shades mix it with black in 10% steps, like Sass mix(). Harmonies rotate the hue in HSL space — 180° for complementary, ±30° analogous, 120° triadic, 150°/210° split-complementary and 90° steps for tetradic.
Is anything sent to a server?
No. All conversions happen in JavaScript in your browser; no color you enter is uploaded or stored.