Developer Tools

Color Converter

Convert colors between HEX, RGB, HSL, HSV, and CMYK, and check WCAG contrast.

Convert a color between HEX, RGB, HSL, HSV and CMYK and see its contrast against white and black, entirely in your browser. Resizing or converting the images that use these colors? Try the Image Converter.

Your input never leaves your device. Conversion happens entirely in your browser.

Accepts HEX (3, 4, 6 or 8 digits), rgb()/rgba(), hsl()/hsla(), hsv() and cmyk(). CSS color names are not supported.

Converted values

  • HEX

    #1e90ff

  • RGB

    rgb(30, 144, 255)

  • HSL

    hsl(209.6, 100%, 55.9%)

  • HSV

    hsv(209.6, 88.2%, 100%)

  • CMYK

    cmyk(88.2%, 43.5%, 0%, 0%)

HSL, HSV and CMYK are rounded to one decimal place. CMYK is a simple mathematical conversion, not a print color profile.

WCAG contrast

On white: 3.24:1

AA text: FailAA large: PassAAA text: FailAAA large: Fail

On black: 6.49:1

AA text: PassAA large: PassAAA text: FailAAA large: Pass
Ratios compare this color, used as text, against pure white and pure black backgrounds, using the WCAG 2.x formula. Transparency is ignored. Large text means 18 pt (24 px) or 14 pt bold.

How it works

Private color conversion in your browser

1

Enter a color

Type a HEX, RGB, HSL, HSV or CMYK value, or pick one with the color picker.

2

See every format

The same color is shown in all formats, including alpha when present.

3

Check contrast

WCAG contrast ratios against white and black show which text color is readable.

Use cases

When this comes in handy

Translate design values

Turn a HEX code from a design file into the rgb() or hsl() form your CSS uses.

Build accessible color pairs

Check whether text on a background meets WCAG AA or AAA contrast.

Adjust a color by hue or lightness

Read a color's HSL values to see how to make it lighter, darker or less saturated.

FAQ

Common questions

Is my input sent anywhere?

No. Everything is calculated in your browser.

Which formats can I enter?

HEX (3, 4, 6 or 8 digits, with or without #), rgb()/rgba(), hsl()/hsla(), hsv() and cmyk(). CSS color names such as "tomato" are not supported.

Is the CMYK value suitable for print?

No. CMYK here is the standard mathematical conversion from sRGB. Real print results depend on the printer, ink and color profile, so use it as a starting point only.

Are the conversions exact?

HEX and RGB are exact whole numbers. HSL, HSV and CMYK are shown rounded to one decimal place, so converting back can differ by one in a channel.

How is contrast calculated?

Using the WCAG 2.x relative luminance and contrast ratio formulas. Transparency is ignored: the color is treated as opaque.

Related Tools