Convert sRGB colors and check text contrast
Compare HEX, RGB, HSL, HSV and approximate CMYK values for interface design and color handoffs. Keep transparency separate from color channels, then check a foreground and background pair under the stated compositing conditions.
How to use the color converter
- Enter a 3, 4, 6 or 8-digit HEX value, edit a channel group, or use the color picker.
- Adjust Alpha if needed. Copy HEXA, RGBA or HSLA when transparency must be preserved; HEX and HSL omit Alpha.
- Set a background in the contrast checker. Keep the main color linked or edit an independent foreground, then review the AA and AAA results.
What each color format represents
- HEX / RGB
- HEX encodes red, green and blue channels in hexadecimal. This tool uses integer sRGB channels from 0 to 255. HEXA adds Alpha at the end: #RRGGBBAA, not #AARRGGBB.
- HSL / HSV
- Both use hue and saturation, but HSL lightness and HSV value are different coordinates. A lightness of 50% does not mean a relative luminance of 50%, so HSL lightness alone cannot determine text contrast.
- CMYK
- CMYK is a basic mathematical estimate from sRGB here. No ICC profile, paper, ink limit or rendering intent is applied. For print production, use a color-managed workflow and the printer's specified profile.
- Alpha
- Alpha controls opacity: 0% is fully transparent and 100% is opaque. It does not change the stored RGB channels. A transparent color's visible appearance depends on the background underneath it.
Color conversion examples
- #FF0000
RGB 255, 0, 0
HSL 0°, 100%, 50%
HSV 0°, 100%, 100%- #33669980
- RGB is 51, 102, 153. Alpha is 128/255, approximately 50.1961%, rather than exactly 50%. HEXA stores only 256 possible Alpha levels.
- #000000 / #FFFFFF
- Opaque black against opaque white has a contrast ratio of 21:1. Fully transparent text over its background has a ratio of 1:1 because the visible colors are identical.
Interpreting WCAG AA and AAA contrast
For ordinary text, AA requires at least 4.5:1 and AAA at least 7:1. For large text, the thresholds are 3:1 and 4.5:1. Large text is at least 18 pt (24 CSS px), or 14 pt bold (about 18.67 CSS px).
The checker uses WCAG 2.x relative luminance after sRGB Alpha compositing. A transparent background is first composited onto white, then the foreground onto that result. Gradients, images, blending modes and the rest of a page's accessibility are outside this calculation.
Color converter FAQ
Can I paste any CSS color expression?
The HEX fields accept hexadecimal colors only. Enter RGB and other components in their labeled fields. Named colors, rgb() text, Lab, OKLCH and Display P3 are not parsed. HSV and CMYK outputs are data values, not CSS color functions.
Why can values change slightly between formats?
RGB is quantized to 8-bit channels; other numeric displays use up to four decimal places. Alpha is retained internally when unrelated channels change. RGBA and HSLA show up to six Alpha decimals; HEXA rounds Alpha to the nearest byte. Repeated conversions can still introduce rounding differences.
Why does a displayed ratio near a threshold say Fail?
The displayed ratio is rounded for readability, but the pass/fail comparison is not. A true ratio below 4.5:1 fails ordinary-text AA even if its rounded display reads 4.500.