Color Converter & Generator
An all-in-one color converter and picker. Switch seamlessly between HEX, RGB, HSL, and CMYK formats, inspect WCAG contrast ratios, and generate monochromatic color shades.
#4F46E5
rgb(79, 70, 229) • hsl(243, 75%, 59%)
Color Code Conversions
Click Copy to get values#4F46E5
CSS: #4F46E5
rgb(79, 70, 229)
Red: 79, Green: 70, Blue: 229
hsl(243, 75%, 59%)
Hue: 243°, Sat: 75%, Light: 59%
cmyk(66%, 69%, 0%, 10%)
C:66% M:69% Y:0% K:10%
RGB Color Sliders
Color Tints & Shades Palette
Click any swatch to copyWCAG Text Contrast Accessibility
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
🇰ðŸ‡Cambodian Heritage Palette
Modern Tech Palette
About & How It Works
Technical calculation logic, standards, and operational details
The Color Converter & Generator is a comprehensive color science tool that converts color values between the four most widely used digital color models — HEX (hexadecimal RGB), RGB (Red, Green, Blue), HSL (Hue, Saturation, Lightness), and CMYK (Cyan, Magenta, Yellow, Key/Black) — in real time. It additionally evaluates the WCAG 2.1 contrast ratio between the selected color and standard white/black backgrounds, enabling designers to verify accessibility compliance for text legibility at Normal (AA: 4.5:1) and Large Text (AA: 3:1) thresholds. The tool generates a set of monochromatic tints and shades by varying the HSL lightness parameter, providing a design-ready color palette.
Algorithmic Logic & Calculation
All conversions pass through an internal RGB [0–255] representation as the canonical interchange format. HEX is parsed by extracting 2-character hex substrings (parseInt(hex, 16)). RGB-to-HSL uses the chroma-based normalization algorithm: H is computed from the dominant channel, S from chroma/lightness, L from (max+min)/2. HSL-to-RGB reverses via the hue sextant method. RGB-to-CMYK normalizes to [0–1] scale, computes K = 1 − max(R,G,B), then derives C, M, Y. WCAG contrast ratio is (L1 + 0.05) / (L2 + 0.05) where L is relative luminance from the IEC 61966-2-1 sRGB gamma function.
Color model conversions follow IEC 61966-2-1 (sRGB) standard. WCAG contrast ratios comply with Web Content Accessibility Guidelines (WCAG) 2.1 Success Criterion 1.4.3. CMYK approximation uses standard device-independent RGB-to-CMYK transform.
Key Features & Capabilities
HEX ↔ RGB ↔ HSL ↔ CMYK Live Conversion
Enter any color model value and see all other representations update in real time.
WCAG 2.1 Contrast Ratio Checker
Evaluates AA and AAA contrast levels against white and black backgrounds for accessibility compliance.
Monochromatic Shade & Tint Generator
Generates a palette of 10 tints (lighter) and 10 shades (darker) from any base color.
One-Click CSS Copy
Copy color as hex(#), rgb(), hsl(), or rgba() CSS notation with a single click.
Practical Real-World Use Cases
UI/UX Design & Brand Guidelines
Designers convert brand primary colors from CMYK (print) to HEX/RGB (digital screen) for consistent cross-media color reproduction.
Web Accessibility WCAG Compliance
Front-end developers verify that text color combinations meet WCAG 2.1 Level AA minimum contrast ratios before launching websites.
Khmer Typography Color Pairing
Publishers and news editors select contrasting text and background colors that maintain Khmer script readability at small sizes.
How to Use
- Use the color picker or enter any HEX/RGB/HSL string.
- See immediate conversions across all color models.
- Click to copy CSS snippets or palette shades.
Client-Side Security Guide: Why In-Browser Tools Protect Your Sensitive Data
Learn how modern WebAssembly and JavaScript enable private, 100% in-browser utilities that guarantee zero data leakage, ideal for API keys, JSON payloads, and sensitive tokens.
Frequently Asked Questions
Related Developer Tools
View all →JSON Formatter & Validator
Prettify, minify, validate, and format JSON code with syntax diagnostics.
UUID / GUID Generator
Generate cryptographically random UUID v4 strings in bulk with custom casing.
Base64 Encoder & Decoder
Encode and decode UTF-8 text and files/images to Base64 format.
