Hex Color to RGB, RGBA, HSL, HSV & CMYK Precision Converter
Convert HEX color codes into CSS rgb(), rgba() with opacity, hsl(), hsv(), and print-ready CMYK values with real-time contrast checking and WCAG compliance ratings.
Hex Color Input
Visual Swatch & Alpha Preview
Converted Color Formats
rgb(59, 130, 246)rgba(59, 130, 246, 1.00)hsl(217, 91%, 60%)hsla(217, 91%, 60%, 1.00)cmyk(76%, 47%, 0%, 4%)hsv(217, 76%, 96%)rgb(59 130 246 / 100%)Developer Code Snippets
:root {
--brand-color: #3B82F6;
--brand-color-rgb: 59, 130, 246;
--brand-color-alpha: rgba(59, 130, 246, 1.00);
--brand-color-hsl: hsl(217, 91%, 60%);
}Color Harmonies & Palettes
100% Private Browser Execution
All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.
Instant Live Preview
Instant real-time reactive computation delivers immediate feedback on every keystroke with zero network latency.
Production Standards & Compliance
Outputs clean, cross-browser CSS and visual values verified against modern web layout standards.
Hex to RGB & Color Space Conversion Reference Guide
Mathematical conversion equations, alpha channel syntax, and WCAG contrast ratio calculations for HEX, RGB, HSL, and CMYK.
Standard Web Color Codes & Conversion Matrix Table
Standard CSS 16-color palette and common web UI colors, with exact 6-digit Hexadecimal, RGB decimal tuples, HSL values, and best UI practices.
| Color Name | Hex Code | RGB Decimal | HSL Value | Best Web UI Usage |
|---|---|---|---|---|
| Black | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) | Deep dark backgrounds, high-contrast headings, terminal interfaces |
| White | #FFFFFF | rgb(255, 255, 255) | hsl(0, 0%, 100%) | Light theme canvas, inverted high-legibility dark mode typography |
| Pure Red | #FF0000 | rgb(255, 0, 0) | hsl(0, 100%, 50%) | Destructive actions, error alerts, live broadcast indicator badges |
| Lime Green | #00FF00 | rgb(0, 255, 0) | hsl(120, 100%, 50%) | System operational status, success pills, verified green checks |
| Pure Blue | #0000FF | rgb(0, 0, 255) | hsl(240, 100%, 50%) | Default browser hyperlink blue, information badges, interactive focus rings |
| Pure Yellow | #FFFF00 | rgb(255, 255, 0) | hsl(60, 100%, 50%) | Warning banners, caution highlights, high-visibility search markers |
| Cyan / Aqua | #00FFFF | rgb(0, 255, 255) | hsl(180, 100%, 50%) | Tech accents, modern dark mode gradients, data visualization highlights |
| Magenta / Fuchsia | #FF00FF | rgb(255, 0, 255) | hsl(300, 100%, 50%) | Marketing callouts, creative portfolio branding, gradient stop points |
| Silver | #C0C0C0 | rgb(192, 192, 192) | hsl(0, 0%, 75%) | Subtle borders, divider rules, disabled input borders in light theme |
| Gray | #808080 | rgb(128, 128, 128) | hsl(0, 0%, 50%) | Secondary metadata text, placeholder text, neutral icon fills |
| Maroon | #800000 | rgb(128, 0, 0) | hsl(0, 100%, 25%) | Severe security warning banners, enterprise alert headers |
| Navy Blue | #000080 | rgb(0, 0, 128) | hsl(240, 100%, 25%) | Enterprise navbar backgrounds, financial UI primary button fills |
| Olive | #808000 | rgb(128, 128, 0) | hsl(60, 100%, 25%) | Earthy theme palettes, subtle status chips, dark mode highlight accents |
| Purple | #800080 | rgb(128, 0, 128) | hsl(300, 100%, 25%) | Visited hyperlink state, AI feature badges, premium tier badges |
Key Parameters & Controls
| Parameter | Type / Unit | Description | Default |
|---|---|---|---|
| hexString | string (#RRGGBB | #RRGGBBAA) | Hexadecimal color code string with optional 8-digit alpha transparency. | — |
| rgbChannels | { r: 0-255, g: 0-255, b: 0-255 } | Base-10 integer RGB intensity channels. | — |
| alphaChannel | number (0.0 to 1.0) | Opacity factor where 0 is completely transparent and 1 is fully opaque. | — |
| cmykPercentages | { c: %, m: %, y: %, k: % } | Subtractive color model percentages used in offset and digital print production. | — |
Pro Tips & Best Practices
Modern CSS supports 8-digit hex codes where the last two digits represent alpha transparency (e.g., #3B82F680 represents 50% opacity).
For digital text legibility, WCAG 2.1 requires a minimum contrast ratio of 4.5:1 for normal body text and 3:1 for large headings (Level AA).
Converting RGB to CMYK is an approximation because computer screens (additive RGB) encompass a wider color gamut than physical printing inks (subtractive CMYK).
Common Gotchas & Troubleshooting
⚠️Invalid Hex Code error
Ensure the hex string begins with '#' and consists only of valid hexadecimal characters (0-9, A-F) in lengths of 3, 4, 6, or 8 characters.
⚠️Shorthand hex expansion disparity
3-digit hex codes expand by duplicating each character (#abc becomes #aabbcc, not #abc000).
Frequently Asked Questions
How do you convert a 6-digit hex code to RGB manually?▼
Split the code into three 2-digit pairs: RR, GG, BB. Convert each pair from hexadecimal (base 16) to decimal (base 10). Example: #FF8000 -> R=255, G=128, B=0.
How do you convert RGB to HSL?▼
Normalize RGB channels between 0 and 1. Find Max and Min values. Lightness = (Max + Min) / 2. Hue and Saturation are derived from color sector angles and chromatic difference.
What is the difference between RGB and CMYK?▼
RGB is an additive light model used for illuminated digital displays. CMYK is a subtractive ink model used for physical print publications.
Are color codes uploaded to external servers?▼
No. All color space conversions and math routines run 100% client-side in your web browser.
Related Tools & Utilities
All Tools →High-precision in-browser color space converter between HEX, RGB, HSL, HSV, and CMYK models with delta-E accuracy, perceptual shade generation, and one-click CSS variable export.
Extract color palettes from images instantly. Generate dominant hex, RGB, and HSL swatches, export CSS or Tailwind tokens, and test WCAG accessibility contrast.
Upload any image to pick exact pixel colors with loupe magnification, automatically generate harmonious dominant color palettes, and copy HEX, RGB, HSL, or CSS codes.
Generate complementary, monochromatic, analogous, and triadic color schemes with instant WCAG 2.1 AAA accessibility contrast scoring.
Test UI palettes and designs against Protanopia, Deuteranopia, Tritanopia, and Achromatopsia using accurate color blindness matrix transforms.
Evaluate foreground and background color contrast against WCAG 2.1 Level AA/AAA and APCA readability standards with live text simulation and auto-fixes.