CMYK to HSL Converter

CMYK to HSL: cmyk(0%, 45%, 90%, 5%) = hsl(30, 89%, 52%). See the formula worked step by step, a reference table, and our test of every CMYK value.

How to use CMYK to HSL

  1. 1Enter an ink recipe.
  2. 2Read hue, saturation and lightness of the formula's screen colour.
  3. 3Use the hsl() value in CSS and adjust lightness as needed.

Features

  • Ink recipe to hue angle
  • Magenta–yellow mixes compared with a real profile
  • Shows how different recipes collapse to one colour

How CMYK to HSL conversion works

To describe an ink recipe in HSL, the converter first predicts its RGB with the naive formula, then measures hue, saturation and lightness from that RGB. Seeing a print colour as HSL makes it easy to reason about: which hue the inks produce, how light, and how vivid.

  • CMYK → RGB: R = 255 × (1 − C)(1 − K), G = 255 × (1 − M)(1 − K), B = 255 × (1 − Y)(1 − K).
  • R′, G′, B′ = RGB ÷ 255; Cmax, Cmin, Δ.
  • L = (Cmax + Cmin) ÷ 2; S = Δ ÷ (1 − |2L − 1|).
  • H from the largest channel, as for any RGB → HSL conversion.

Worked example: cmyk(0%, 45%, 90%, 5%) to HSL

Here is the converter's own calculation for cmyk(0%, 45%, 90%, 5%), step by step. The result, hsl(30, 89%, 52%), is exactly what the tool above shows for this input.

  • As fractions: C = 0, M = 0.45, Y = 0.9, K = 0.05.
  • R = 255 × (1 − 0) × (1 − 0.05) = 242.25 → 242.
  • G = 255 × (1 − 0.45) × (1 − 0.05) = 133.24 → 133.
  • B = 255 × (1 − 0.9) × (1 − 0.05) = 24.22 → 24.
  • R′ = 242 ÷ 255 = 0.949, G′ = 0.522, B′ = 0.094.
  • Cmax = 0.949, Cmin = 0.094, Δ = 0.855.
  • L = (0.949 + 0.094) ÷ 2 = 0.522.
  • S = 0.855 ÷ (1 − |2 × 0.522 − 1|) = 0.893.
  • Red is largest: H = 60° × ((0.522 − 0.094) ÷ 0.855 mod 6) = 30°.
  • Rounded: hsl(30, 89%, 52%).

Magenta and yellow mixes in CMYK and HSL

Common ink recipes and what they become on screen.

ColourCMYKHSL
M100 Y0cmyk(0%, 100%, 0%, 0%)hsl(300, 100%, 50%)
M80 Y20cmyk(0%, 80%, 20%, 0%)hsl(315, 100%, 60%)
M60 Y40cmyk(0%, 60%, 40%, 0%)hsl(340, 100%, 70%)
M50 Y50cmyk(0%, 50%, 50%, 0%)hsl(0, 100%, 75%)
M40 Y60cmyk(0%, 40%, 60%, 0%)hsl(20, 100%, 70%)
M20 Y80cmyk(0%, 20%, 80%, 0%)hsl(45, 100%, 60%)
M0 Y100cmyk(0%, 0%, 100%, 0%)hsl(60, 100%, 50%)
M60 Y100cmyk(0%, 60%, 100%, 0%)hsl(24, 100%, 50%)
M30 Y100cmyk(0%, 30%, 100%, 0%)hsl(42, 100%, 50%)
M100 Y100cmyk(0%, 100%, 100%, 0%)hsl(0, 100%, 50%)

Precision test: every CMYK value through the converter

Across all 104,060,401 whole-number recipes the converter produces 2,048,030 distinct HSL values. Converting HSL back to CMYK gives the same colour 19.017% of the time (worst 5 levels), though usually with a different recipe.

Method: every whole-number CMYK value, through the converter's own code and back, compared on the 0–255 scale (how we test).

MeasureResult
CMYK values tested104,060,401
Distinct HSL results2,048,030
Came back exactly19.017%
Largest change (0–255 levels)5
Average change1.0759

Last updated · Source: Pixohub exhaustive test of lib/color-math.ts

Formula vs a real print profile

Mixing magenta and yellow in different proportions walks from magenta through red to yellow. The formula predicts screen-pure hues (#FF00FF for 100% magenta), but through the profile magenta ink is #D70A7D, a far less saturated colour. The largest per-channel difference was 130 levels.

The converter above uses the standard formula. To show what a colour-managed conversion does, we converted the same colours with LittleCMS 2.19 through the Generic CMYK profile that ships with macOS (relative colorimetric intent with black point compensation, the default in Photoshop). Your printer's profile will give different numbers again, but in the same direction.

RecipeC/M/Y/KFormulaProfile
M100 Y00/100/0/0#FF00FF#D70A7D
M80 Y200/80/20/0#FF33CC#E0537D
M60 Y400/60/40/0#FF6699#E57D77
M50 Y500/50/50/0#FF8080#EA8F73
M40 Y600/40/60/0#FF9966#EDA26D
M20 Y800/20/80/0#FFCC33#F8C853
M0 Y1000/0/100/0#FFFF00#FFF100
M60 Y1000/60/100/0#FF6600#E67928
M30 Y1000/30/100/0#FFB200#F2B326
M100 Y1000/100/100/0#FF0000#D81F26

Last updated · Source: Pixohub test, macOS Generic CMYK Profile via LittleCMS

Where you'll use CMYK to HSL

Building a web palette from print inks

Converting a set of print builds to HSL shows their hue spread and lightness at a glance, useful when extending a print palette to the web.

Understanding overprints

The magenta-yellow mixes below show how two inks combine into reds and oranges, with hue moving roughly in step with the ratio.

CSS for print-derived colours

Writing the result as hsl() makes later adjustments (lighter hover, darker border) simple.

Common mistakes

  • Reading S = 100% as a sign the colour will print vividly: it describes the formula's screen colour, not the ink.
  • Assuming K changes hue: it only lowers lightness (and in the profile, saturation).
  • Using these values to judge whether a print colour is in gamut.
  • Converting HSL back and expecting the original ink recipe.

Frequently asked questions

What is cmyk(0%, 45%, 90%, 5%) in HSL?

hsl(30, 89%, 52%), an orange. The formula gives rgb(242, 133, 24), and red as the brightest channel with green in the middle puts the hue at exactly 30°.

Does the profile change the hue?

Usually a little, but mainly it lowers saturation, because real inks reflect less pure light than the formula assumes.

Why does 100% magenta show as pink on screen?

The formula's magenta is #FF00FF. Real magenta ink is closer to a cool pink-red, which is what the profile column shows.

Can I use these values in CSS?

Yes. Copy the hsl() value; just remember it's the formula's screen colour.

More text, code & dev tools