What this free color converter computes
Modern design and engineering workflows constantly cross color-model boundaries: brand guides arrive in HEX or CMYK print specs, legacy CSS stylesheets use RGB or RGBA, design tokens adopt HSL for quick lightness tweaks, and newer CSS Color 4 systems standardize on perceptually uniform OKLCH. Switching between separate calculators for every format breaks focus and introduces rounding drift. This free color converter parses any HEX, RGB, or HSL input and outputs all five notations simultaneously inside your browser with zero sign-up.
Adjust the opacity slider to append 8-digit hex alpha, RGBA, HSLA, and modern OKLCH slash alpha syntax automatically, then copy a ready-to-paste CSS custom properties block in one click. Every conversion executes locally via pure color-science math with zero network calls.
How to convert HEX, RGB, HSL, OKLCH, and CMYK in one step
Paste a 3-digit or 6-digit hex code (with or without a leading hash), an rgb() triplet, or an hsl() string directly into the input box, or pick a color visually using the native swatch control.
Inspect the five live output cards immediately beneath the preview swatch: HEX (including 8-digit alpha when opacity is below 100%), RGB/RGBA, HSL/HSLA, perceptually uniform OKLCH with lightness percentage, chroma, and hue angle, and print-oriented CMYK percentages.
Drag the Opacity slider whenever you need translucent borders, glass surfaces, or subtle focus rings. The generated CSS block automatically switches every web format to its corresponding alpha syntax while preserving the opaque CMYK print reference in a clean comment.
Click Copy CSS variables to paste the entire token snippet directly into your stylesheet, Tailwind theme, or Figma documentation notes.
When to choose HEX, RGB, HSL, OKLCH, or CMYK
HEX remains the universal shorthand for brand guidelines, Figma handoffs, and compact JSON token files. Six hexadecimal characters encode sRGB red, green, and blue channels cleanly, while eight characters append alpha opacity supported across every modern browser.
RGB and RGBA are helpful when computing pixel blends in HTML5 Canvas, WebGL shaders, or image processing scripts where numeric 0–255 channel math is required directly.
HSL organizes color into intuitive Hue, Saturation, and Lightness coordinates, making quick hover-state darkening readable in hand-written stylesheets. However, HSL lightness is not perceptually uniform — pure yellow at 50% lightness looks far brighter than pure blue at 50% lightness.
OKLCH solves that perceptual gap by separating true human-perceived lightness (L), chroma (C), and hue (H). Two buttons with different hues but identical OKLCH lightness maintain consistent WCAG contrast ratios against white or dark backgrounds. CMYK translates screen values into cyan, magenta, yellow, and black ink percentages for quick print-brief checks.
Precision tips for design-to-engineering handoff
Because CMYK describes subtractive physical inks on paper while sRGB describes additive light on screens, extremely vivid neon blues and electric greens shift slightly when printed. Use the CMYK readout here as a fast directional reference and request an ICC-profiled proof from your print vendor for packaging runs.
When migrating an existing CSS codebase from HEX to OKLCH, keep both tokens side by side during rollout or verify the converted OKLCH values in modern Chromium, Safari, and Firefox browsers. Rounding OKLCH lightness to one decimal place and chroma to four decimal places keeps stylesheets tidy while preserving sub-pixel visual fidelity.
Another practical check during handoff is verifying opacity syntax consistency. Mixing hex colors with separate CSS opacity rules fades nested text and icons along with the container fill, whereas converting a single brand token into RGBA, HSLA, or OKLCH alpha syntax keeps borders and surface tints translucent while leaving child labels crisp and readable.
Instant local color math with zero external APIs
Every sRGB linearization, cube-root OKLab matrix transform, polar OKLCH projection, and CMYK separation runs locally in TypeScript inside your active tab. No proprietary brand palettes or client color specs are ever logged or uploaded, and the tool continues working offline after initial load.
Because there are no rate limits, pop-up ads, or account gates, you can convert dozens of design tokens in rapid succession while auditing a full component library. Keyboard-first engineers can paste a value, nudge opacity, copy the generated :root variable snippet, and move straight to the next token in seconds.
Consistent color representation across Figma libraries, CSS stylesheets, iOS Swift assets, and print vendor specs eliminates silent drift where a brand red slowly shifts across web headers, email footers, and pitch slides. Converting from a single source of truth keeps every channel mathematically anchored.
Inspect real brand tokens from UINice design systems
Click any preset swatch in the right panel to load the primary accent color of a documented UI design system from the UINice catalog and inspect its exact HEX, RGB, HSL, OKLCH, and CMYK equivalents. Follow the design system link below the swatches to see how that color pairs with neutral surfaces, ink text, and live interface layouts.
Studying how real design systems balance OKLCH lightness and chroma across neutral paper backgrounds, deep charcoal inks, and vibrant primary buttons helps you calibrate your own custom tokens with confidence. Open any linked UINice design system entry to inspect full multi-stop token sheets, component recipes, and typography hierarchies ready for production use across marketing pages, dashboards, and mobile apps.
Questions
Which input formats does this color converter accept?
You can type or paste 3-digit or 6-digit HEX codes (such as #e0244a or e0244a), rgb()/rgba() strings, hsl()/hsla() strings, or pick visually with the color input.
Why does OKLCH look different from HSL numbers for the same color?
HSL uses mathematical channel averages, whereas OKLCH models human visual perception through linear sRGB and OKLab matrices so equal lightness values actually appear equally bright.
Does the converter support alpha transparency across formats?
Yes. Moving the Opacity slider below 100% automatically updates 8-digit HEX, rgba(), hsla(), and oklch(... / alpha%) notation inside the CSS variables output.
Does this tool send my brand colors to an external server?
No. Every color space conversion runs completely locally inside your browser tab with zero network requests, zero server logging, and full offline support after the initial page load.