Color Converter: HEX, RGB, HSL, OKLCH and CMYK
Type a color in almost any CSS notation or pick one with the color picker, and see it in every other format at once: HEX with and without alpha, rgb(), hsl(), hwb(), oklch(), oklab(), CMYK and the closest CSS name when it is an exact match. Each value has its own copy button and transparency is kept in every format.
Below the conversions, a contrast checker compares your color as text against white, black and a second color of your choice, and reports the WCAG AA and AAA results for normal and large text. A strip of nine shades and tints helps you build a quick palette. All of it is calculated in your browser, with nothing sent anywhere.
Contrast checker
Shades and tints
About the formats and the maths
HEX, rgb(), hsl() and hwb() all describe the same sRGB colors in different ways. RGB gives the red, green and blue light levels, HSL and HWB describe the same color as hue plus lightness or whiteness, which is easier to adjust by hand. OKLab and OKLCH are newer CSS color spaces based on how people see color, so equal changes in lightness look more equal than in HSL, which makes them popular for building palettes. The tool uses the published OKLab matrices and the standard sRGB transfer function.
Some OKLCH and OKLab values are outside what an sRGB screen can show. The tool clips such a color to the nearest displayable sRGB value and tells you it did. Values you type are kept at full precision, and the shown numbers are rounded, which is why converting a color to a format and back can differ by a fraction of a step. The tests in this tool check that every shown format returns the same color to within half a step per channel, except CMYK, which is checked to within one.
CMYK needs a careful word. The CMYK values here come from the plain textbook formula that turns RGB into ink percentages. They are approximate, because real printing depends on the paper, the inks and an ICC color profile, none of which this tool has. Use them as a rough guide, not as print-ready values. The contrast checker follows WCAG 2.x: relative luminance from linear light, a ratio from 1 to 21, and the AA and AAA thresholds of 4.5, 3, 7 and 4.5.
- Reads HEX (3, 4, 6, 8 digits), rgb(), rgba(), hsl(), hsla(), hwb(), oklch(), oklab(), cmyk() and the 148 CSS color names.
- Shows every format at once with copy buttons and keeps alpha.
- A color picker plus a text box, kept in sync.
- CMYK clearly marked as approximate, with no ICC profile.
- WCAG contrast ratio against white, black and a second color, with AA and AAA results shown in words and symbols.
- Nine shades and tints, each copyable.
How to use the Color Converter
- Type a color, for example #3b82f6 or oklch(70% 0.15 250), or use the picker.
- Copy the format you need from the list.
- Pick a second color in the contrast section to test text on that background.
- Click a shade or tint to copy its HEX value.
Is it private?
Yes. Colors are converted by your own browser and are not uploaded or stored.
Read our tools privacy policy →
Frequently asked questions
Which color formats can I type in?
HEX with 3, 4, 6 or 8 digits (with or without #), rgb() and rgba() in comma or space syntax with an optional slash alpha, hsl() and hsla(), hwb(), oklch(), oklab(), cmyk() with percentages or fractions, and any of the 148 CSS color names. Hue angles accept deg, grad, rad and turn.
How accurate is the CMYK result?
It is approximate. The tool uses the simple formula that derives ink percentages straight from RGB, with no ICC profile. Printed colors depend on the paper and inks, so check a proof before printing and do not treat these numbers as print-ready.
What does it mean that a color was clipped?
OKLCH and OKLab can describe colors that a normal sRGB screen cannot display. The tool moves such a color to the closest value an sRGB screen can show, and tells you that it did, because the other formats then describe the clipped color.
What do WCAG AA and AAA mean?
They are levels of the Web Content Accessibility Guidelines for the contrast between text and its background. AA needs 4.5 to 1 for normal text and 3 to 1 for large text (about 24 px, or 19 px bold). AAA asks for 7 to 1 and 4.5 to 1. Meeting a level helps readability but is only one part of accessible design.
How are the shades and tints made?
Tints mix your color with white in steps of 20, 40, 60 and 80 percent, and shades mix it with black in the same steps, with the original in the middle. It is plain mixing in sRGB, which is simple and predictable, but not perceptually even.
Does the tool upload my colors?
No. All conversions are calculated in your browser. Nothing is uploaded, stored or sent anywhere.