The CMYK to RGB formula inverts each color ink, multiplies the result by (1 - K), and scales it to the 0-255 display range, following the W3C device-cmyk naive fallback. For any cyan, magenta, yellow, and black percentage, the red, green, and blue channels are computed as R = 255 × (1 - C) × (1 - K), G = 255 × (1 - M) × (1 - K), and B = 255 × (1 - Y) × (1 - K), where C, M, Y, and K are normalized to 0-1. The same formula appears in a more defensive form in the W3C CSS Color 4 specification: 1 - min(1, colorInk × (1 - black) + black), scaled to 255, with half-even tie rounding. Both expressions are mathematically identical for any input between 0 and 1; the min() clamp only matters if you pass a value outside that range. This is the formula implemented by the CMYK to RGB tool, so you can move the sliders, watch the math update live, and confirm the result for any recipe you already have.
Anyone who has pasted a CMYK recipe from a printer's swatch book into a website mockup has run into the same gap: print uses subtractive ink mixing on paper, while screens use additive light mixing, and the bridge between them is rarely a single number. The naive formula is the closest one-line approximation the W3C working group could publish without dragging an ICC profile into the browser, which is why it is treated as the default fallback inside CSS. It is also why the formula is so widely copied: it is short, deterministic, and good enough for interface mockups, palette comparisons, and quick on-screen checks against a printed chip.

The CMYK to RGB Formula, Component by Component
CMYK is a subtractive model: each ink absorbs part of the light reflecting off the paper, so more ink generally means less light reaching your eye. RGB is additive: each channel adds light, so higher values mean more brightness. The naive formula handles that flip by inverting each ink percentage — subtracting it from 1 — and then combining the result with the black channel through multiplication. The multiplication by (1 - K) is the key step that distinguishes a real CMYK recipe from a simple CMY reverse.
Here is the formula written out for every channel:
- R = 255 × (1 - C) × (1 - K)
- G = 255 × (1 - M) × (1 - K)
- B = 255 × (1 - Y) × (1 - K)
Where C, M, Y, and K are each the percentage divided by 100, so they sit in the 0 to 1 range. The (1 - K) factor darkens every channel at once when black ink is added, which matches the way a printer layers key (black) on top of the color inks rather than letting them stack to a muddy brown. After you compute the three real numbers, round each one to an integer from 0 to 255. The W3C reference implementation uses half-even rounding (also called banker's rounding) so values sitting exactly on a half round to the nearest even neighbor rather than always rounding up.
The defensive form in the W3C spec rewrites the same expression as 1 - min(1, colorInk × (1 - K) + K), then multiplies by 255. Expanding the parentheses inside the min(): colorInk × (1 - K) + K = colorInk − colorInk·K + K. One minus that expression simplifies to (1 - K)(1 - colorInk), which is the same product used in the simpler form. The min() exists only to guard against inputs outside the 0 to 1 range, so for any honest CMYK recipe you can use whichever form is easier to type.
How to Apply the Formula to Any CMYK Recipe
Following the same six steps the tool performs on every slider change gives a reproducible result you can verify by hand.
- Normalize the four percentages. Divide cyan, magenta, yellow, and black by 100 so each value sits in the 0 to 1 range.
- Compute (1 - K). Subtract the normalized black from 1; this single factor will be reused on every channel.
- Compute each ink's leftover reflectance by taking (1 - C), (1 - M), and (1 - Y).
- Multiply each leftover reflectance by (1 - K) to get a 0 to 1 value for R, G, and B.
- Scale each value to 0–255 by multiplying by 255 and rounding to the nearest integer using half-even rules.
- Serialize to hex. Write each 8-bit channel as a two-digit hexadecimal pair, for example RGB(204, 51, 102) becomes #CC3366.
If you would rather skip the arithmetic and just see the result for a specific recipe, the CMYK to RGB tool performs these same six steps every time you move a slider, and lets you copy the hex output directly into a stylesheet without leaving the page.
Worked Example: From Print Percentages to RGB
Take a brand red built from full magenta and full yellow with a 50% black added for depth: C = 0%, M = 100%, Y = 100%, K = 50%. Normalize: C = 0, M = 1, Y = 1, K = 0.5. Plug the values into the formula:
- R = 255 × (1 - 0) × (1 - 0.5) = 255 × 1 × 0.5 = 127.5 → 128
- G = 255 × (1 - 1) × (1 - 0.5) = 255 × 0 × 0.5 = 0
- B = 255 × (1 - 1) × (1 - 0.5) = 255 × 0 × 0.5 = 0
The result is RGB(128, 0, 0), a deep, slightly muted red that writes to the screen as #800000. Notice how the 50% black channel pulled the bright red down to half its original luminance without touching the hue: the green and blue channels stayed at 0 because full magenta and full yellow still cancel them out. If you set K = 0 instead, the same recipe yields RGB(255, 0, 0), the pure screen red — which is the endpoint behavior the W3C spec calls out in the naive fallback. Set K = 100 and the same inputs collapse to RGB(0, 0, 0), the screen black endpoint.
Reference Endpoints You Can Sanity-Check
Before trusting any conversion, plug these well-known recipes through the formula. They should always produce the values shown below because the formula is deterministic and the inputs are at the boundaries.
| CMYK recipe | Expected RGB | Hex | What it tests |
|---|---|---|---|
| 0%, 0%, 0%, 0% | 255, 255, 255 | #FFFFFF | No ink produces paper white. |
| 0%, 0%, 0%, 100% | 0, 0, 0 | #000000 | Full key black produces screen black. |
| 0%, 100%, 100%, 0% | 255, 0, 0 | #FF0000 | Full magenta plus full yellow equals red. |
| 100%, 0%, 0%, 0% | 0, 255, 255 | #00FFFF | Full cyan equals screen cyan. |
| 100%, 100%, 0%, 0% | 0, 0, 255 | #0000FF | Full cyan plus magenta equals blue. |
| 0%, 100%, 0%, 0% | 255, 0, 255 | #FF00FF | Full magenta equals screen magenta. |
If any of these endpoints miss in a converter you are testing, the formula is not the W3C naive fallback. The CMYK to RGB tool matches all six, which is a useful sanity check when comparing it to other online converters that quietly substitute a different model. Several common JavaScript snippets published online use a slightly different expression that breaks one or more of these endpoints; running the table above is the fastest way to catch that.
Why This Formula Is an Approximation
The naive formula treats CMYK as a simple algebraic transformation of RGB, which it is not. Real CMYK output is device-dependent: the same percentages can look different on a coated-stock sheet printed with one ink set versus an uncoated sheet printed with another. Dot gain, the way halftone dots physically enlarge on press, can darken midtones by ten percent or more. Rendering intent — perceptual, relative colorimetric, absolute colorimetric, or saturation — changes which out-of-gamut colors get clipped and how. And the most important variable of all, the embedded ICC profile that describes the actual press, is never read by the naive fallback.
Per the W3C CSS Color 4 device-cmyk specification, the formula is explicitly a fallback for cases where no profile is available. It is the right choice for a browser that has no way to load printer profiles safely, and the wrong choice for any task where the printed chip has to match the on-screen color within a tight tolerance. Profile-aware software such as Adobe Acrobat converts between CMYK and RGB by mapping each color through a source profile and a destination profile, which is why the same CMYK recipe can produce visibly different RGB values in Photoshop, Illustrator, or your print shop's RIP.
When to Use the Browser Tool vs Profile-Aware Software
For interface mockups, palette comparisons, accessibility contrast checks, or any screen-bound deliverable, the naive formula is more than good enough. Move the four sliders on the CMYK to RGB page to your recipe, read off the hex code, and paste it into your stylesheet. The calculation runs locally in the browser, so no color values leave the machine, and the result is good enough for "what would this look like on screen" questions where press accuracy is not on the line.
For press proofs, packaging mockups, brand color reproduction, or any deliverable where the printed chip has to match the on-screen preview, do not rely on the naive formula. Keep the original CMYK recipe, ask the printer for the correct output profile, and run the conversion through profile-aware software with a calibrated display and a physical proof. The naive result will get you close enough for a quick screen check, and that is exactly the use case it was designed for. Mixing the two — using a profile-aware conversion for screen mockups, or using the naive formula for press approvals — is the most common source of color mismatch in real projects, and the table of endpoints above is a quick way to spot when a tool has quietly drifted away from the published formula.
For a deeper look, see The Math Behind the Color Mixer's HEX Blends.
For a deeper look, see RGB to CMYK on Mac: Convert in Your Browser.