Convert Any Color Code Across 13 CSS & Perceptual Formats
Color Code Converter parses HEX, HEXA, RGB, RGBA, HSL, HSLA, HSV, HSVA, CIE LAB, CIE LCH, OKLAB, OKLCH, CIE XYZ, and all 148 X11 named colors in real time with full alpha transparency preservation.
Example conversion (#f58223): rgb(245, 130, 35)
How Alpha-Aware Multi-Space Conversion Works
Unlike single-format calculators that strip transparency or ignore modern CSS Color Level 4 spaces, Color Code Converter preserves your alpha channel (0 to 1) across every conversion card simultaneously.
When you enter a color such as #f58223 or oklch(0.722 0.171 53.535 / 0.8), the engine transforms sRGB or perceptual polar coordinates into linear LMS and D65 light, quantizes 8-bit HEX/RGB channels, derives cylindrical HSL/HSV angles, and computes Bradford-adapted D50 CIE Lab/LCH values in a single deterministic pass.
Comparing Classic sRGB vs. Perceptual Color Spaces
Understanding why values differ across formats helps designers and frontend engineers avoid muddy gradients and inconsistent contrast ratios:
- sRGB Formats (HEX, HEXA, RGB, RGBA, HSL, HSLA, HSV, HSVA): Fast, hardware-aligned, and universally supported, though HSL lightness appears much brighter in yellow than in deep blue.
- Oklab & OKLCH: Perceptually calibrated spaces where Lightness (L) matches human brightness perception and Hue (H) stays linear without purple shifts in blue gradients.
- CIE XYZ, LAB & LCH: Foundational colorimetric spaces anchored to human cone response curves and D65/D50 reference white points.
Accessibility & Color Vision Deficiency Testing
Every converted color updates the live result background and hero transparency swatch so you can judge surface feel immediately. Open the Color Vision Deficiency preview below the cards to inspect how protanopia, deuteranopia, tritanopia, and achromatopsia affect your chosen color.
Frequently Asked Questions
What color formats can I paste into the input field?
You can enter 3-, 4-, 6-, or 8-digit HEX/HEXA codes, rgb()/rgba(), hsl()/hsla(), hsv()/hsva(), lab(), lch(), oklab(), oklch(), color(xyz ...), or any of the 148 X11 named colors.
How is alpha transparency handled across opaque and alpha formats?
Alpha-capable formats (HEXA, RGBA, HSLA, HSVA, LAB, LCH, OKLAB, OKLCH, XYZ) always preserve your exact opacity value, while opaque formats (HEX, RGB, HSL, HSV) output the clean solid color channels.
Why does the result background change to match my color?
Setting the result area background to your active color—over a checkerboard for semi-transparent inputs—lets you evaluate real-world surface tinting and readability at full scale.