Skip to content

Color converter: HEX to RGB, HSL, HSV, CMYK and OKLCH

Designers get a brand color as a HEX code, a print shop asks for CMYK, a developer wants HSL or the newer OKLCH for CSS, and a design app shows HSV. This color converter reads a color written in any of those forms, or as a CSS name such as teal, and shows it in all the others at once, each with a copy button. It also checks whether the color is readable as text on a background you choose, using the WCAG 2.2 contrast formula, and builds nine evenly spaced tints and shades. Everything runs in your browser.

Quick answer

Type or paste a color such as #0F766E, rgb(15 118 110), hsl(175 77% 26%) or oklch(51% 0.09 183) and the converter shows the same color as HEX, RGB, HSL, HSV, CMYK, OKLCH, OKLab and its CSS name if it has one. Set a background color to see the WCAG contrast ratio and whether it passes AA and AAA.

Runs in your browser

Based on W3C, WCAG 2.2: contrast ratio and relative luminance · Page updated 23 October 2026

Editor: Abuzar, founder of NeedMyToolsHow we check facts

Type or paste HEX (#0F766E), rgb(), hsl(), hsv(), cmyk(), oklch(), oklab() or a CSS name such as teal.

#0F766E

Need a color from a photo or logo? Use the image color picker, then paste the HEX code here.

The same color in every format

HEX
#0F766E
RGB
rgb(15 118 110)
HSL
hsl(175.3 77.4% 26.1%)
HSV / HSB
hsv(175.3, 87.3%, 46.3%)
CMYK
cmyk(87%, 0%, 7%, 54%)
OKLCH
oklch(51.09% 0.0861 186.39)
OKLab
oklab(51.09% -0.0855 -0.0096)

CMYK here is a simple screen-to-print formula with no printer profile; ask your printer for the values their press needs.

Contrast check (WCAG 2.2)

Normal text: can you read this sentence comfortably?

Large text 24 px

Contrast ratio

5.47:1

  • AA, normal text (4.5:1)Pass
  • AA, large text (3:1)Pass
  • AAA, normal text (7:1)Fail
  • AAA, large text (4.5:1)Pass
  • Icons and UI parts (3:1)Pass

Tints and shades

Nine steps from light to dark with the same OKLCH hue, so the steps look evenly spaced. Tap one to convert it.

How to use the Color Converter

  1. Type or paste your color in the box, in any format, or press the color square to choose one.
  2. Read the same color in every other format on the right and press the copy icon next to the one you need.
  3. Enter a background color under "Contrast check" to see the ratio and which WCAG levels it passes; use the swap button to test the reverse.
  4. Tap any tint or shade to convert it, and press "Download all formats" to keep the values as a file.

What each color format is for

HEX and RGB describe the same thing: how much red, green and blue light a screen pixel mixes, each from 0 to 255; HEX simply writes those three numbers in base 16, so #0F766E is red 15, green 118 and blue 110. HSL (hue, saturation, lightness) and HSV, also called HSB (hue, saturation, value or brightness), rearrange the same RGB color around a color wheel, which is easier for people to adjust: change the hue to move round the wheel, lower saturation to make it greyer. HSL is the one written in CSS; HSV is what most design apps show in their color picker, so the two give different numbers for the same color. CMYK is the ink model of printing. OKLCH is the newest: lightness, chroma and hue designed so that equal steps look equal to the eye.

OKLCH and OKLab, the modern CSS color spaces

HSL has a known flaw: yellow and blue at the same HSL lightness look very different in brightness. OKLab, and OKLCH, its polar form, were designed so that lightness matches what we see. The CSS Color Module Level 4 specification defines them, and current browsers accept oklch() in style sheets. That is why OKLCH is useful for design systems: keep the hue and chroma, change only L, and you get a scale that looks evenly spaced, which is how the tints and shades on this page are built. OKLCH can also describe colors brighter than an ordinary sRGB screen can show. When you type one, the converter keeps its lightness and hue and lowers chroma until it fits, and tells you, so the HEX you copy is the closest color a normal screen will really display.

Contrast ratio and WCAG 2.2 levels

The contrast check uses the formula in the W3C's Web Content Accessibility Guidelines 2.2, a W3C Recommendation dated 12 December 2024, which we opened on 23 October 2026. Each color's relative luminance is worked out from its sRGB values, and the ratio is the lighter one plus 0.05 divided by the darker one plus 0.05, from 1:1 to 21:1. Level AA asks for at least 4.5:1 for normal text and 3:1 for large text, which WCAG defines as at least 18 point, or 14 point bold. Level AAA asks for 7:1 and 4.5:1. Icons, input borders and other parts of the interface need 3:1 against what is next to them. If your text color is semi-transparent, it is first blended with the background, because that blend is what readers see.

CMYK, print and the limits of any converter

Converting a screen color to CMYK with a formula gives a reasonable starting point, but real printing depends on the press, the ink and the paper, described in an ICC color profile that only your printer has. Very bright screen colors, such as pure RGB green, cannot be printed at all, and two printers can ask for different CMYK values for the same brand color. Treat the CMYK line as a guide and ask for a printed proof. HEX, RGB, HSL, HSV and OKLCH are exact conversions of the same sRGB color, rounded to sensible decimals. To find a color in a photo or logo first, use the image color picker; to turn several colors into a background, use the CSS gradient generator.

Frequently asked questions

How does a color converter turn HEX into RGB?

A HEX code is three pairs of base-16 digits for red, green and blue. #0F766E splits into 0F, 76 and 6E, which are 15, 118 and 110 in decimal, so the RGB value is rgb(15 118 110).

Why do HSL and HSV give different numbers for the same color?

Both use hue, but HSL measures lightness, where 100% is always white, while HSV measures brightness, where 100% is the purest version of the hue. The same teal is hsl(175 77% 26%) and hsv(175, 87%, 46%).

What is OKLCH and should I use it in CSS?

OKLCH writes a color as lightness, chroma and hue in a space designed to match how people see. Current browsers support oklch() in CSS, and it is handy for building even color scales. Keep a HEX fallback if you must support very old browsers.

Which contrast ratio does text need to pass WCAG AA?

At least 4.5:1 for normal text and 3:1 for large text (18 point, or 14 point bold). AAA asks for 7:1 and 4.5:1. The ratio is not rounded up: 4.49:1 fails AA for normal text.

Can I convert a color with transparency?

Yes. Enter an 8-digit HEX such as #0F766E80 or rgb(15 118 110 / 50%). The converter keeps the alpha in every CSS format, and the contrast check blends the color with the background first.