Convert any color between HEX, RGB, HSL, HSV, CMYK and OKLCH. Paste a value in any format, see a live preview, and check whether text in that color is readable on white or black.
Try #3498db, rgb(52, 152, 219), 52, 152, 219, hsl(204, 70%, 53%) or a name like teal.
- HEX
- RGB
- HSL
- HSV / HSB
- CMYK
- OKLCH
Contrast (WCAG)
4.5:1 passes AA for normal text, 3:1 for large text, 7:1 passes AAA.
Runs in your browser. Nothing you enter is sent or saved.
How to convert a color
- Type or paste a color: a HEX code like #3498db, rgb(52, 152, 219), just 52, 152, 219, hsl(204, 70%, 53%) or a name like teal. Or use the color picker.
- See the color in every format instantly.
- Click Copy next to the format you need.
- Check the contrast results to see whether text in that color passes accessibility guidelines.
Features
- Six formats: HEX, RGB, HSL, HSV/HSB, CMYK and OKLCH.
- Flexible input: HEX with or without #, 3- or 8-digit HEX, rgb(), rgba(), hsl(), plain numbers and all CSS color names.
- Transparency support: alpha values are kept in HEX, RGB, HSL and OKLCH.
- WCAG contrast check against white and black, with AA and AAA results.
- One-click copy for every value.
Frequently asked questions
How do I convert HEX to RGB?
Split the six digits into three pairs and turn each pair from hexadecimal into a number from 0 to 255. #3498db becomes 52, 152, 219. The converter does this instantly.
What is OKLCH?
OKLCH is a newer CSS color format based on how people actually perceive lightness and color. It makes it easier to create palettes where colors look evenly balanced.
Why is the CMYK value only approximate?
Screens mix light (RGB) and printers mix ink (CMYK). The conversion is a standard formula, but printed results depend on the printer, ink and paper.
What contrast ratio do I need?
For normal text, 4.5:1 passes WCAG AA and 7:1 passes AAA. Large text needs at least 3:1.
Need a custom version of this tool or an API for your business? Get in touch.