How CMYK to HEX conversion works
Turning a CMYK ink recipe into a HEX code means predicting what colour light the printed ink would reflect. The naive formula treats each ink as removing its opposite light channel and black as dimming everything. Real ink doesn't behave that neatly, so profile-based results below are noticeably duller and closer to what the press produces.
- Scale C, M, Y and K to 0–1.
- R = 255 × (1 − C) × (1 − K).
- G = 255 × (1 − M) × (1 − K).
- B = 255 × (1 − Y) × (1 − K).
- Round and write each channel as two HEX digits.
Worked example: cmyk(100%, 72%, 0%, 18%) to HEX
Here is the converter's own calculation for cmyk(100%, 72%, 0%, 18%), step by step. The result, #003BD1, is exactly what the tool above shows for this input.
- As fractions: C = 1, M = 0.72, Y = 0, K = 0.18.
- R = 255 × (1 − 1) × (1 − 0.18) = 0 → 0.
- G = 255 × (1 − 0.72) × (1 − 0.18) = 58.55 → 59.
- B = 255 × (1 − 0) × (1 − 0.18) = 209.1 → 209.
- Red 0 = 0 × 16 + 0 → 00; green 59 = 3 × 16 + 11 → 3B; blue 209 = 13 × 16 + 1 → D1.
- Joined:
#003BD1.
Standard print builds in CMYK and HEX
Common ink recipes and what they become on screen.
| Colour | CMYK | HEX |
|---|---|---|
| Process cyan | cmyk(100%, 0%, 0%, 0%) | #00FFFF |
| Process magenta | cmyk(0%, 100%, 0%, 0%) | #FF00FF |
| Process yellow | cmyk(0%, 0%, 100%, 0%) | #FFFF00 |
| Process black | cmyk(0%, 0%, 0%, 100%) | #000000 |
| Cyan + magenta | cmyk(100%, 100%, 0%, 0%) | #0000FF |
| Magenta + yellow | cmyk(0%, 100%, 100%, 0%) | #FF0000 |
| Cyan + yellow | cmyk(100%, 0%, 100%, 0%) | #00FF00 |
| Rich black 60/40/40/100 | cmyk(60%, 40%, 40%, 100%) | #000000 |
| Cool black 60/0/0/100 | cmyk(60%, 0%, 0%, 100%) | #000000 |
| Warm black 0/60/30/100 | cmyk(0%, 60%, 30%, 100%) | #000000 |
| Registration 100/100/100/100 | cmyk(100%, 100%, 100%, 100%) | #000000 |
| 50% black | cmyk(0%, 0%, 0%, 50%) | #808080 |
Precision test: every CMYK value through the converter
All 104,060,401 whole-number CMYK recipes (101 levels for each of four inks) give a HEX code that reproduces the computed colour exactly (100%), but they reach only 11,641,458 distinct codes. Many recipes, especially dark ones, collapse onto the same HEX value.
Method: every whole-number CMYK value, through the converter's own code and back, compared on the 0–255 scale (how we test).
| Measure | Result |
|---|---|
| CMYK values tested | 104,060,401 |
| Distinct HEX results | 11,641,458 |
| Came back exactly | 100% |
| Largest change (0–255 levels) | 0 |
| Average change | 0 |
Last updated · Source: Pixohub exhaustive test of lib/color-math.ts
Formula vs a real print profile
Standard press builds show how optimistic the formula is. Process cyan becomes #00FFFF by formula, a pure screen cyan, but #00A3DB through the profile, which is much closer to how cyan ink actually looks on paper. Across these builds the formula and profile disagreed by up to 135 levels on a single channel.
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.
| Recipe | C/M/Y/K | Formula | Profile |
|---|---|---|---|
| Process cyan | 100/0/0/0 | #00FFFF | #00A3DB |
| Process magenta | 0/100/0/0 | #FF00FF | #D70A7D |
| Process yellow | 0/0/100/0 | #FFFF00 | #FFF100 |
| Process black | 0/0/0/100 | #000000 | #111111 |
| Cyan + magenta | 100/100/0/0 | #0000FF | #222978 |
| Magenta + yellow | 0/100/100/0 | #FF0000 | #D81F26 |
| Cyan + yellow | 100/0/100/0 | #00FF00 | #009848 |
| Rich black 60/40/40/100 | 60/40/40/100 | #000000 | #000000 |
| Cool black 60/0/0/100 | 60/0/0/100 | #000000 | #00000B |
| Warm black 0/60/30/100 | 0/60/30/100 | #000000 | #090000 |
| Registration 100/100/100/100 | 100/100/100/100 | #000000 | #000000 |
| 50% black | 0/0/0/50 | #808080 | #878A89 |
Last updated · Source: Pixohub test, macOS Generic CMYK Profile via LittleCMS
Where you'll use CMYK to HEX
Putting print brand colours on the web
A brand guide may give only CMYK. A profile-based conversion (the right-hand column below) gives a web colour that looks like the printed piece; the formula usually gives something too bright.
Previewing ink builds
Before printing a rich black or a two-colour overprint, convert it to see roughly what it will look like on screen.
Checking a supplier's file
If a PDF arrives with CMYK values, the conversion shows what colour the designer intended.
Common mistakes
- Trusting the formula's bright results for brand colours: process cyan is not #00FFFF in real life.
- Treating registration black (100/100/100/100) as a colour: it is a technical colour for crop marks only.
- Assuming different CMYK recipes are different colours: many dark builds map to the same screen colour.
- Expecting the HEX to convert back to the same CMYK: the round trip picks the formula's own recipe, usually with a different K.