# Color Converter (HEX, RGB, HSL, CMYK)

URL: https://speedycalculator.com/calculators/conversion/color-converter/
Last updated: 2026-10-25

> The color converter converts a colour between HEX, RGB, HSL, HSV and CMYK, shows a live swatch and calculates WCAG contrast ratios against white and black text. Everything is calculated in your browser; nothing you type is sent to our server.

## Inputs

- Input format
- Colour

## Results

- Colour
- HEX
- RGB
- HSL
- HSV / HSB
- CMYK
- Decimal value
- Contrast with white
- Contrast with black
- Readable text colour

## Formula

```
HEX: each pair of hex digits = one RGB channel (00–FF = 0–255)
HSL/HSV from RGB via the standard hexcone formulas
CMYK: K = 1 − max(R,G,B)/255
```

## Explanation

Designers, developers and printers describe colours in different systems: HEX and RGB for screens, HSL and HSV for picking shades, CMYK for print. This converter translates between all of them and checks text contrast for accessibility.

### How to use the Color Converter

- **Input format**
- **Colour**

Everything runs in your browser, so results appear instantly and nothing you type is sent to a server.

### How it works

Your colour is parsed in the format you choose and converted to RGB first; every other notation is computed from RGB. CMYK here is a simple device-independent conversion; professional printing uses colour profiles that can shift the values.

## Worked example

Inputs — Input format: HEX (#RRGGBB); Colour: #1E90FF.

Results — **HEX = #1E90FF**; RGB = rgb(30, 144, 255); HSL = hsl(210, 100%, 56%); HSV / HSB = hsv(210, 88%, 100%); CMYK = cmyk(88%, 44%, 0%, 0%); Decimal value = 2,003,199.

## Key terms

- **HEX code**: A colour written as #RRGGBB in hexadecimal.
- **Contrast ratio**: WCAG measure of luminance difference between text and background, from 1:1 to 21:1.

## FAQ

**How do I convert HEX to RGB?**
Split the code into three pairs and convert each from base 16 to base 10: FF = 255.

**What contrast ratio do I need for text?**
WCAG asks for at least 4.5:1 for normal text and 3:1 for large text.

**Can I enter a 3-digit HEX code?**
Yes: #F80 is read as #FF8800.

**What formula does the Color Converter use?**
HEX: each pair of hex digits = one RGB channel (00–FF = 0–255).


## Sources

- [W3C – Web Content Accessibility Guidelines 2.1, Contrast (Minimum)](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)
- [W3C – CSS Color Module Level 4](https://www.w3.org/TR/css-color-4/)
