Color Converter
Convert colors between HEX, RGB, HSL, HSV, and CMYK with WCAG contrast ratios
/v1/color-convert
curl "https://devtools.toolkitapi.io/v1/color-convert?color=%23FF5733"
import httpx
resp = httpx.get(
"https://devtools.toolkitapi.io/v1/color-convert?color=%23FF5733",
)
print(resp.json())
const resp = await fetch("https://devtools.toolkitapi.io/v1/color-convert?color=%23FF5733", {
});
const data = await resp.json();
console.log(data);
# See curl example
{
"hex": "#FF5733",
"rgb": {"r": 255, "g": 87, "b": 51},
"hsl": {"h": 10.6, "s": 100.0, "l": 60.0},
"hsv": {"h": 10.6, "s": 80.0, "v": 100.0},
"cmyk": {"c": 0.0, "m": 0.659, "y": 0.8, "k": 0.0},
"css_name": null,
"contrast": {
"white": 3.07,
"black": 6.85,
"wcag_aa_normal_white": false,
"wcag_aa_normal_black": true,
"wcag_aaa_normal_white": false,
"wcag_aaa_normal_black": false
}
}
Try It Live
Description
How to Use
1. Pass a color value in the `color` query parameter. Supported formats: - HEX: `#FF5733` or `#F53` (3-digit shorthand) - RGB: `rgb(255,87,51)`
2. URL-encode the `#` as `%23` in query strings.
3. Inspect the response for all color model conversions and WCAG contrast data.
About This Tool
Color Converter takes a color in HEX or RGB format and converts it to every major color model — HEX, RGB, HSL, HSV, and CMYK — in a single call. It also calculates WCAG contrast ratios against white and black backgrounds, making it easy to check accessibility compliance.
If the color matches a named CSS color (e.g. `red`, `teal`, `gold`), the `css_name` field is populated.
Why Use This Tool
- Design handoff — Convert between color formats for CSS, print, and design tools
- Accessibility auditing — Check WCAG AA/AAA contrast compliance against white and black
- Color documentation — Generate a complete color profile from a single HEX value
- Theming — Convert brand colors to HSL for generating shade/tint palettes
Frequently Asked Questions
Which input formats are supported?
How are WCAG contrast ratios calculated?
What colors have a `css_name`?
Start using Color Converter now
Get your free API key and make your first request in under a minute.