Stockio
Creator & Productivity Runs in your browser

Color Converter (HEX, RGB, HSL, CMYK)

Convert colours between HEX, RGB, HSL and CMYK in one place.

Loading tool…

Color conversion expresses the same approximate sRGB color through different coordinate systems. HEX is compact for design tokens, RGB matches display channels, and HSL is often easier to discuss in terms of hue and lightness. CMYK describes a subtractive model associated with printing, while OKLCH provides a perceptually oriented representation useful in modern CSS. This converter connects those representations in one editable workspace.

How to use it

  1. Start with the sample blue or replace the HEX field with a three- or six-digit value.
  2. Edit RGB, HSL, or CMYK if that is the representation supplied by your design source.
  3. Check the large swatch to confirm that the resulting color matches your intention.
  4. Copy each generated format with the adjacent button.
  5. Read the OKLCH value when preparing modern CSS or documenting a token system.

Understanding the output

HEX encodes red, green, and blue as hexadecimal channel pairs. A short value such as #abc expands to #AABBCC. RGB channels range from 0 to 255. HSL uses a hue angle from 0 to 360 with saturation and lightness percentages. CMYK accepts four percentage channels: cyan, magenta, yellow, and black. Invalid text produces a visible error rather than silently inventing a different color.

For the default #3B82F6, the RGB result is rgb(59, 130, 246) and the rounded HSL result is hsl(217, 91%, 60%). Displayed values are rounded for practical copying, so repeated conversions through a rounded representation can introduce small channel differences. Keep a canonical source token if exact reproduction matters across exports.

Understanding the CMYK limitation

The CMYK conversion uses a simple mathematical relationship with sRGB. Real print reproduction depends on paper, inks, press behavior, rendering intent, and an ICC color profile. The displayed CMYK percentages are therefore a planning aid, not a proof-ready press specification. Ask your print supplier for the correct profile and proof workflow before approving physical production.

Pro tips

  • Preserve the original HEX or RGB value as a stable reference during collaboration.
  • Use the same source space when comparing colors across applications.
  • Check foreground and background combinations for accessibility separately.
  • Treat a swatch as context-dependent rather than an absolute visual guarantee.

The read-only OKLCH output is derived by linearizing sRGB, converting to OKLab, and expressing chromatic coordinates as chroma and hue. Lightness appears as a percentage, chroma as a decimal, and hue as an angle. This does not expand an sRGB input into a wider-gamut original; it simply describes that input in another coordinate system.

Common mistakes and use cases

An alpha channel is not supported here, so provide an opaque color rather than a four- or eight-digit HEX value. HSL saturation is also not equivalent to perceptual chroma, and HSL lightness is not a contrast measurement. Two colors with equal HSL lightness can have very different relative luminance.

Use the converter to translate a brand token, inspect a palette handoff, or explain channel values in documentation. If a copied format is intended for CSS, verify that the syntax is supported in your target browsers. In particular, the CMYK display is a channel description, not a universally supported CSS declaration.

Further reading and practical checks

Read HEX, RGB, HSL, CMYK, and OKLCH conversion: practical background for a broader workflow, and use the related contrast checker tool when the next task requires it. The official reference provides additional technical context. Keep those references alongside your own acceptance criteria so a convenient result does not become an undocumented assumption.

Before handing off work, compare one known example against a manually verified expectation. Save the original input, identify the settings that matter, and explain any approximation to the next person. Small checks catch unit mistakes, formatting differences, and misplaced confidence early. When requirements change, repeat the same example before applying the workflow to a larger collection.

Keep context with the result

A copied result is easier to reuse when its source and purpose are clear. Include a short note describing where the input came from, which part of the output matters, and what you expect a teammate to verify. Avoid sharing sensitive source material unnecessarily. When a result seems surprising, reduce the example to the smallest input that reproduces it, then compare that case against the documented rules. This turns an ambiguous discrepancy into a concrete question that is much easier to investigate.

Frequently asked questions

Can I enter three-digit HEX?+

Yes, each digit is duplicated to create a six-digit value. For example, #abc becomes #AABBCC.

Does this support transparency?+

No, this tool converts opaque colors. Supply an RGB color without an alpha channel.

Are CMYK values print-ready?+

They are approximate mathematical conversions. Accurate print output requires the correct ICC profile and a proofing workflow.

Why can round trips change the result?+

Displayed HSL and CMYK values are rounded. Converting rounded values back to RGB can introduce small differences.

Does OKLCH guarantee accessibility?+

No, a color coordinate does not establish contrast with its background. Test the actual foreground and background pair separately.

Articles that use this tool

In-depth articles with the Color converter built right in.

Design Systems

Design Tokens Explained: Bridging Designers and Developers

Create a practical design-token system with semantic color roles, CSS custom properties, reviewed conversions, and a safe migration process for teams.

Includes: Color converterJonah WeissJonah Weiss
Typography & Colour

Display P3 vs sRGB: Choosing Color Spaces for the Web

Build a reliable sRGB foundation, add Display P3 accents with safe CSS fallbacks, and check that wider color never compromises readability or brand consistency.

Includes: Color converterArjun RamanArjun Raman
HTML & CSS

HEX vs RGB vs HSL: How to Convert CSS Colors Correctly

Learn when to use HEX, RGB, and HSL, convert values without changing the intended colour, and avoid alpha, rounding, and percentage mistakes in CSS.

Includes: Color converterMarcus BellMarcus Bell
Typography & Colour

OKLCH Color Palette: Build Balanced Colors in CSS

Build practical OKLCH palettes with controlled lightness, chroma, and hue, then check gamut limits, CSS fallbacks, and real interface colour pairs.

Includes: Color converterArjun RamanArjun Raman
Typography & Colour

How to Use Complementary Colors Without Clashes

Create usable complementary colour palettes by separating hue contrast from lightness and saturation, with practical ratios and CSS examples for digital work.

Includes: Color converterJonah WeissJonah Weiss
Typography & Colour

Analogous Color Palette: Build One With Clear Hierarchy

Build harmonious analogous palettes with neighbouring hues while preserving clear accents, useful neutrals, and readable foreground-background combinations.

Includes: Color converterNoor HaddadNoor Haddad