Color Converter (HEX, RGB, HSL)
Convert colors between HEX, RGB, HSL, OKLCH and CMYK, see their shades, tints and harmonies, and check WCAG contrast against white, black or any color.
Read as HEX.
- HEX
- #0f766e
- RGB
- rgb(15, 118, 110)
- HSL
- hsl(175.3, 77.4%, 26.1%)
- HWB
- hwb(175.3 5.9% 53.7%)
- OKLCH
- oklch(51.09% 0.0861 186.39)
- OKLab
- oklab(51.09% -0.0855 -0.0096)
- CMYK (approximate)
- cmyk(87%, 0%, 7%, 54%)
- Nearest name
- tealclosest match
Shades, tints and harmonies
Click a color to use it. Copy gives a row's HEX codes.
Shades, mixed with black
Tints, mixed with white
Complementary
Analogous
Triadic
Split complementary
Square
Contrast checker
5.47:1contrast ratio
| WCAG 2 | AA | AAA |
|---|---|---|
| Normal text | Passneeds 4.5:1 | Failneeds 7:1 |
| Large text | Passneeds 3:1 | Passneeds 4.5:1 |
Runs in your browser. Nothing you enter is uploaded.
How to use
This tool converts a color between HEX, RGB, HSL, HWB, OKLCH, OKLab and CMYK, shows the colors that go with it, and checks its contrast with another color.
- Type or paste a color into Color. It reads:
- Hex codes with 3, 4, 6 or 8 digits, like
#ff6347or#ff634780. - The CSS functions
rgb(),hsl(),hwb(),oklch(),oklab()andcmyk(), with commas or spaces, with or without alpha. - The 148 CSS color names, like
tomatoorrebeccapurple. - A whole CSS line, like
color: #ff6347;.
- Hex codes with 3, 4, 6 or 8 digits, like
- Or click the swatch to use your device's color picker.
- Copy any format from the list. Choose Commas or Spaces for
rgb()andhsl(), and turn on Uppercase HEX if you like. Values are rounded only as far as they still convert back to the same HEX. - Nearest name shows the CSS color name that matches, or the closest one.
Shades, tints and harmonies shows your color mixed with black and with white, 10% more each time, as CSS color-mix() in OKLab does. Below them are the colors that go with it on the color wheel: complementary, analogous, triadic, split complementary and square. Classic (HSL) is the usual wheel. Even lightness (OKLCH) keeps every color as light as yours. Click any color to use it, or copy a whole row.
The Contrast checker compares your color with white, black or a second color. It shows the WCAG 2 contrast ratio and whether text passes AA and AAA, at normal and large sizes.
An OKLCH color outside sRGB, the range HEX can hold, is brought inside by lowering its chroma, as CSS Color 4 describes, and the tool tells you. CMYK uses a simple formula with no printer profile, so treat it as a starting point for print.
Frequently asked questions
What is the difference between HEX, RGB and HSL?
They describe the same colors in different ways. HEX and RGB give the amounts of red, green and blue, HEX in base 16. HSL gives hue, saturation and lightness, which is easier to adjust by hand.
Why use OKLCH?
OKLCH is built so that equal steps in its numbers look like equal steps to the eye. Two colors with the same lightness really look equally light, which makes palettes and readable color pairs easier to plan. Current browsers support it in CSS.
What contrast ratio do I need?
WCAG 2 level AA needs 4.5:1 for normal text and 3:1 for large text, which is 24 px, or about 19 px when bold. Level AAA needs 7:1 and 4.5:1. The tool never rounds a ratio up to reach a pass.
Related tools
- QR code generator Make QR codes for links, Wi-Fi, contacts, text messages, places and more.
- Base64 encoder Encode text or files to Base64 and decode Base64 back to text or a file.
- Unix timestamp converter Convert Unix timestamps in seconds, milliseconds or nanoseconds to dates in any time zone, and dates back, one or a list at once.
More calculators
- Percentage calculator Work out X% of a number, what percent one number is of another, the whole from a part, the percentage change, or a price with or before tax or a discount.
- Age calculator Work out an exact age from a date of birth: years, months and days, the same in weeks and days, the weekday of birth, and how long until the next birthday.
- Date calculator Count the days, weeks, months and working days between two dates, or add or take away days, weeks, months, years or working days from a date.
- Will it fit? Check if a sofa or any furniture fits through a doorway, round a hallway corner or into a lift or car, and which way to tilt it.