Developer tools
HEX to RGB Color Converter (and HSL, HSV, CMYK)
Convert a colour between HEX, RGB, HSL, HSV and CMYK in one step, including transparency. Paste a code in any format or pick a colour, then copy the format you need and check its text contrast.
- HEX
- #2F5BFF
- RGB
- rgb(47, 91, 255)
- HSL
- hsl(227, 100%, 59%)
- HSV
- hsv(227, 82%, 100%)
- CMYK
- cmyk(82%, 64%, 0%, 0%)
Contrast for text
White text: 5.17:1AA
Black text: 4.06:1AA large text only
AA needs 4.5:1 for normal text and 3:1 for large text; AAA needs 7:1. Contrast is measured on the solid colour.
Everything is converted on your device.
How to use the HEX to RGB Color Converter
- Paste a colour in any format, such as #2F5BFF or rgb(47, 91, 255), or use the picker.
- Adjust the opacity if you need transparency.
- Copy the HEX, RGB, HSL, HSV or CMYK value.
Frequently asked questions
- How do I convert HEX to RGB?
- Split the six digits into three pairs and read each pair as a number from 0 to 255. For #2F5BFF that's 2F = 47, 5B = 91 and FF = 255, so rgb(47, 91, 255). This tool does it as you type.
- What about 8-digit HEX codes?
- The last two digits are the opacity (alpha), from 00 (transparent) to FF (solid). #2F5BFF80 is about 50% opaque. Short forms like #abc and #abcd work too.
- Why do CMYK values look different in print?
- Screen-to-print conversion depends on the printer, ink and paper. The CMYK shown here is a simple mathematical conversion; ask your printer for their colour profile for exact results.
- What does the contrast ratio mean?
- It measures how readable text is on the colour. Accessibility guidelines (WCAG) ask for at least 4.5:1 for normal text and 3:1 for large text.
- Is anything sent anywhere?
- No. Conversions happen on your device.
Related tools
- Base64 Decode and EncodeDecode Base64 to readable text or encode text to Base64 as you type, with full support for accents and emoji (UTF-8) and the URL-safe variant. You can also turn a file into Base64 or save decoded Base64 as a file. Everything stays on your device.
- Case ConverterChange text to UPPERCASE, lowercase, Sentence case, Title Case, aLtErNaTiNg case and more with one click, then copy it. What you type stays on your device.
- QR Code GeneratorTurn any link or text into a QR code and download it as a PNG. It's free, needs no sign-up, and what you type stays on your device.