Skip to main content

Free Color Converter

Convert colors between HEX, RGB, HSL, HSV, and CMYK formats instantly. Includes a lightness scale and preset swatches.

Works offline once loaded

Convert a color between HEX, RGB, HSL, HSV and CMYK β€” with a live preview and one-tap copy. Everything runs in your browser.

Accepts: HEX (#fff or #ffffff), RGB (255, 255, 255), or HSL (360, 100%, 50%)

100%
Presets:
HEX#14B8A6
rgb() Β· legacyrgb(20, 184, 166)
rgb() Β· modernrgb(20 184 166)
hsl() Β· legacyhsl(173, 80%, 40%)
hsl() Β· modernhsl(173 80% 40%)
oklch()oklch(70.4% 0.123 182.5)
lab()lab(67.1% -42.9 -2.3)
lch()lch(67.1% 43.0 183.1)
hsv()hsv(173, 89%, 72%)
cmyk()cmyk(89%, 0%, 10%, 28%)
RGB values20, 184, 166

WCAG contrast

On white background

2.49:1

Fail

On black background

8.44:1

AAA
πŸ–¨οΈ For print: These CMYK values (89%, 0%, 10%, 28%) are a standard sRGBβ†’CMYK approximation for reference. For accurate print colour, use your printer's ICC profile or a printed proof β€” screen CMYK can't match every ink/paper.

Lightness scale

Click any swatch to switch to that shade

Common uses

  • Convert Colors for Web DesignGet HEX, RGB, and HSL values for any colour β€” ready to paste into CSS or Tailwind.
  • Convert Colors for Print (CMYK)Convert screen colours (HEX/RGB) to CMYK values for use in print design and professional printing.
  • Build Color Palettes for Design SystemsConvert brand colours across all formats and generate consistent lightness scales for a full design system.
  • Check Colour Contrast for AccessibilityConvert colours to get RGB values for use in contrast ratio tools β€” WCAG compliance for accessible design.
  • Convert Colors for FigmaGet the exact HEX and RGB values to paste into Figma colour pickers and design token systems.

How It Works

All conversion logic is hand-written JavaScript running entirely in your browser β€” no library, no server call. The tool parses your input, routes it through a chain of pure math functions, and simultaneously produces eleven output formats including the modern CSS Color 4 spaces oklch() and lab().

  1. 1
    Flexible input parsing
    A custom parser accepts hex (3, 4, 6, or 8 digits), rgb()/rgba(), hsl()/hsla() in both legacy comma syntax and modern space syntax, and bare numeric triples. Alpha values as decimals or percentages are normalized to the 0–1 range before any conversion begins.
  2. 2
    RGB as the conversion hub
    Every accepted format is first resolved to a canonical RGB triplet. From that single representation the tool fans out: HSL and HSV use the standard min/max/chroma formulas; CMYK is derived by finding the key channel; and sRGB linearization (the piecewise gamma curve defined in IEC 61966-2-1) is applied before the perceptual-space calculations.
  3. 3
    Perceptual color spaces computed from scratch
    oklch() is computed using BjΓΆrn Ottosson's reference 3Γ—3 matrices (LMS cube-root space). lab() and lch() use Bradford chromatic adaptation to convert from the D65 white point to D50, which matches how CSS Color 4 defines lab(). These are the same formulas used in browser rendering engines β€” implemented here without any external dependency.
  4. 4
    WCAG contrast and lightness scale
    Relative luminance is calculated per the WCAG 2.1 formula (linearized R, G, B weighted 0.2126/0.7152/0.0722) and the contrast ratio against white and black is graded AA-large, AA, AAA, or Fail. A nine-step lightness strip is generated by stepping the HSL lightness channel from 10% to 90%, letting you click any swatch to convert that shade.

Related Tools

Frequently Asked Questions