Color Converter
HEX, RGB, HSL, OKLCH and Contrast

Edit any format and the rest follow. Convert between HEX, RGB, HSL, HWB, OKLCH, CMYK and CSS color names, then check WCAG contrast and preview your color pair as people with color blindness see it. 100% client-side. Zero data stored.

One color shown as HEX, RGB, HSL and OKLCH values with a contrast ratio badge

Color Converter Tool

Convert a Color

100%

Device CMYK from a simple formula, with no ink or paper profile. A printer will not match it exactly.

WCAG Contrast Checker

Large text sample

Normal text sample: the quick brown fox jumps over the lazy dog.

A translucent text color is blended onto the background first, and a translucent background onto white.

4.54:1 contrast ratio
AA, normal text (4.5:1)
AAA, normal text (7:1)
AA, large text (3:1)
AAA, large text (4.5:1)
AA, icons and UI components (3:1)

Color Blindness Preview

Your text and background pair as it appears with each type of color vision deficiency, with the contrast ratio that remains. This is an approximation of full dichromacy, not a medical test.

Normal vision
Protanopia
No red cones
Deuteranopia
No green cones
Tritanopia
No blue cones
Achromatopsia
No color, only light and dark

Common Use Cases

Design to CSS

Paste a HEX from a design file and copy the same color as RGB, HSL, HWB or OKLCH for your stylesheet.

Accessibility Audits

Check a text and background pair against WCAG 2.x AA and AAA, and get the closest shade that passes.

Modern OKLCH Colors

Convert existing brand colors to OKLCH to build even lightness scales and predictable hover and dark-mode shades.

Color-Blind Safe Pairs

See whether a red-on-green status label still reads when red and green look alike, and how much contrast survives.

Print Starting Points

Get a rough CMYK value for a screen color as a starting point, then confirm it with your printer's own profile.

Name That Color

Find the CSS color name for a value, or the closest named color when there is no exact match.

Color Format and WCAG Reference

Formats You Can Type

Format Example Notes
HEX#1E90FF, #1E9, #1E90FF80, #1E983, 4, 6 or 8 digits; the # is optional; 4 and 8 digits carry alpha
RGBrgb(30 144 255 / 50%)0-255 or percentages; commas or spaces
HSLhsl(210 100% 56%)Hue in deg, turn, rad or grad
HWBhwb(210 12% 0%)Hue, whiteness, blackness
OKLCHoklch(65.2% 0.19 253.2)Lightness, chroma, hue; out-of-gamut values are pulled into sRGB
CMYKcmyk(88%, 44%, 0%, 0%)Device CMYK, approximate
Namedodgerblue, rebeccapurpleAll 148 CSS color names and transparent

WCAG 2.x Contrast Requirements

Content Level AA Level AAA
Normal text4.5:17:1
Large text (24px, or 18.66px bold)3:14.5:1
Icons, borders, form controls3:1No separate level

The ratio is (lighter luminance + 0.05) divided by (darker luminance + 0.05), from 1:1 to 21:1. It is compared exactly, so 4.499 fails AA. This is the WCAG 2.x method, not the newer APCA model.

Rounding

HSL and HWB are shown in whole numbers, OKLCH as 65.2% 0.190 253.2, and CMYK in whole percents, so a round trip can land one step away.

sRGB only

Every result is an sRGB color. Wide-gamut values such as Display P3 are not shown, and an OKLCH color beyond sRGB is reduced in chroma.

Same math as the Palette tool

Conversions and contrast use the same formulas as the Color Palette Generator, so both give the same answer.

Do not rely on color alone

Contrast ratios and simulations help, but pair color with text, icons or patterns so nothing depends only on a hue.

Pro Tip: URL Parameters

Open the tool with a color already loaded using ?color= for the converter, and ?fg= and ?bg= for the contrast checker. For example: /color-converter/?color=1E90FF or /color-converter/?fg=767676&bg=FFFFFF

Values can be HEX with or without the #, or a CSS color name. If you pass only ?color=, it also becomes the text color. The Copy Link button builds a link to your current colors.

Frequently Asked Questions

Why We Built This Color Converter

A color rarely stays in one format. The design file gives you a HEX, the stylesheet wants HSL, the new CSS uses OKLCH, a print shop asks for CMYK, and the accessibility audit wants a contrast ratio. Most converters handle two of those and leave the rest to separate pages. We built one page where every format is editable, every field stays in sync, and each value has its own copy button.

The contrast checker follows WCAG 2.x, compares the exact ratio, and offers the nearest shade that passes instead of just saying no. The color blindness preview shows the pair as people with protanopia, deuteranopia, tritanopia and achromatopsia see it, so you can catch a red-and-green label before it ships. Everything runs in your browser - nothing you type is sent anywhere.

The Color Converter is part of RJL.io's collection of free developer tools. Build harmonious schemes with the Color Palette Generator, size type with the REM Converter, and write CSS faster with our Gradient Generator.

Is your site ready for Google and AI search?

The free SEO Analyzer checks any page in seconds - meta tags, structured data, AI crawler access - and tells you exactly how to fix each issue on your platform.