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.
Color Converter Tool
Convert a Color
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.
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.
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, #1E98 | 3, 4, 6 or 8 digits; the # is optional; 4 and 8 digits carry alpha |
| RGB | rgb(30 144 255 / 50%) | 0-255 or percentages; commas or spaces |
| HSL | hsl(210 100% 56%) | Hue in deg, turn, rad or grad |
| HWB | hwb(210 12% 0%) | Hue, whiteness, blackness |
| OKLCH | oklch(65.2% 0.19 253.2) | Lightness, chroma, hue; out-of-gamut values are pulled into sRGB |
| CMYK | cmyk(88%, 44%, 0%, 0%) | Device CMYK, approximate |
| Name | dodgerblue, rebeccapurple | All 148 CSS color names and transparent |
WCAG 2.x Contrast Requirements
| Content | Level AA | Level AAA |
|---|---|---|
| Normal text | 4.5:1 | 7:1 |
| Large text (24px, or 18.66px bold) | 3:1 | 4.5:1 |
| Icons, borders, form controls | 3:1 | No 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
Type or paste the HEX value into the HEX field, with or without the #. The RGB, HSL, HWB, OKLCH, CMYK and name fields update at once. By hand, split the six digits into three pairs and read each pair as a hexadecimal number from 0 to 255, so 1E is 30, 90 is 144 and FF is 255.
Yes. #1E9 is shorthand for #11EE99, and the 4 and 8 digit forms add an alpha channel at the end, so #1E90FF80 is dodger blue at about 50 percent opacity. The Opacity slider does the same thing, and the other formats switch to rgba, hsla or a slash alpha automatically.
OKLCH describes a color by lightness, chroma (how vivid it is) and hue, in a space designed so that equal lightness steps look equal. That makes it good for building color scales and for hover and dark-mode shades that stay consistent. Browsers support oklch() in CSS, and this page converts to and from it.
Very vivid OKLCH colors can fall outside the sRGB range that HEX and RGB can store. This tool keeps the lightness and hue and lowers the chroma until the color fits, and shows a note so you know the result is a reduced version. Wide-gamut spaces such as Display P3 are not supported.
It is an approximation. The tool uses the simple device CMYK formula that works directly from the RGB numbers. Real printing depends on the inks, the paper and a color profile, so the same screen color prints differently on different presses, and many saturated screen colors cannot be printed at all. Use it as a starting point and confirm with your printer.
WCAG 2.x level AA asks for 4.5:1 for normal text and 3:1 for large text and for icons and form controls. Level AAA asks for 7:1 for normal text and 4.5:1 for large text. Large means at least 24 pixels, or 18.66 pixels and bold. The checker compares the exact ratio, so 4.499:1 fails AA. It does not use the newer APCA model.
When the text color fails AA, the tool moves its lightness in OKLCH toward both black and white while keeping the hue and as much chroma as fits, then offers the version that changes the least and just reaches 4.5:1. If AA already passes but AAA does not, it offers the nearest shade that reaches 7:1. Pick Use this color to apply it.
It uses the published Machado model for full dichromacy (no red, green or blue cones) applied in linear RGB, and a luminance-only gray for achromatopsia. Many people have a milder deficiency, and screens differ, so treat the preview as a quick check that a pair keeps enough contrast, not as a medical simulation. It also cannot test a whole page layout.
Yes. Add ?color= to preload the converter, and ?fg= and ?bg= to preload the contrast checker, for example /color-converter/?fg=767676&bg=FFFFFF. Use HEX with or without the # or a CSS color name. The Copy Link button builds the link from your current colors.
No. Every conversion, contrast check and simulation runs in your browser with JavaScript. Nothing you type is sent, logged or stored, and the tool keeps working offline once the page has loaded.
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.