HEX, RGB & HSL Converter
Convert CSS colors, preview them and check readable black or white text contrast.
How to use HEX, RGB & HSL Color Converter
Convert colours between HEX, RGB and HSL with a live preview and contrast check.
- Type a HEX value, or RGB, or HSL numbers.
- The other fields, preview and CSS values update instantly (the field you are typing in is never overwritten).
- Copy the CSS values.
What you get
HEX, RGB, HSL and best text colour with contrast ratio.
Options explained
| Option | What it does |
|---|---|
| HEX | 3, 4, 6 or 8 digits, with or without #. Tidied to #RRGGBB when you leave the field. |
| Red / Green / Blue | 0–255. Values outside the range are not clamped; the field is marked and “Red: 0–255 only.” (etc.) is shown. |
| Hue / Saturation % / Lightness % | 0–360 and 0–100. |
| Preview | Shows the colour with the more readable text colour (black or white) and its contrast ratio. |
| Copy CSS values | Copies HEX, rgb() and hsl() lines. |
| Contrast checker | Pick a text colour to test on the current background. Shows the contrast ratio and whether it passes WCAG AA/AAA for normal and large text. |
| Palette | Tints and shades of the colour plus complementary, analogous and triadic hues. Click a swatch to load it. |
Limits & tips
- Every tool follows the same three steps shown above it — 1 Upload or enter input, 2 Choose options, 3 Preview & download — with a status line that says what to do next. On a computer the options sit on the left and middle and the preview & result panel stays on the right; progress (with % where available) is shown inside that panel. On phones the steps stack in order. Start over clears the tool.
- Aim for a contrast of at least 4.5:1 for body text.
Explore more utilities, or browse the complete tool sitemap.