How to use the cmyk to hex converter
- Enter the Cyan percentage (0 to 100) in the first field.
- Fill in Magenta, Yellow and Key (Black) percentages.
- The HEX code, RGB triplet and CSS
rgb()string appear automatically below the inputs. - Copy the hexadecimal value directly into your stylesheet or design tool.
How the CMYK to HEX conversion works
The math behind this conversion starts by turning each ink percentage into a decimal between 0 and 1. Each RGB channel is then computed with this formula:
R = 255 x (1 - C) x (1 - K)
The same pattern applies to green (using M) and blue (using Y). Once you have the three RGB integers, each is converted to a two-digit hexadecimal number and concatenated with a leading hash.
For example, converting C=75, M=68, Y=67, K=90 gives R = 255 x 0.25 x 0.10 = 6.375, which rounds to 6. Green becomes 8 and blue becomes 8. The final hex code is #060808.
Common CMYK to HEX reference values
This table lists standard process colors and their hexadecimal equivalents. Use it as a quick lookup when you need an answer without entering values manually.
| Color name | C | M | Y | K | HEX |
|---|---|---|---|---|---|
| White | 0 | 0 | 0 | 0 | #FFFFFF |
| Black | 0 | 0 | 0 | 100 | #000000 |
| Cyan | 100 | 0 | 0 | 0 | #00FFFF |
| Magenta | 0 | 100 | 0 | 0 | #FF00FF |
| Yellow | 0 | 0 | 100 | 0 | #FFFF00 |
| Red | 0 | 100 | 100 | 0 | #FF0000 |
| Green | 100 | 0 | 100 | 0 | #00FF00 |
| Blue | 100 | 100 | 0 | 0 | #0000FF |
Why screen colors differ from print
CMYK is a subtractive model used for printing: inks absorb light, so combining all four at 100 percent produces near-black. Screens use an additive RGB model where combining red, green and blue light at full intensity produces white. Because of this fundamental difference, turning ink percentages into screen light is always an approximation.
Print profiles such as U.S. Web Coated SWOP apply complex curves that a simple linear formula cannot replicate perfectly. For critical brand work, designers compare physical proofs against calibrated monitors rather than relying solely on mathematical conversion.
Using the results in CSS
Once you have the result, the resulting six-character code can be placed directly in any CSS property that accepts a color. For example, color: #060808; sets text to the dark shade calculated above.
If you prefer functional notation, the tool also provides the rgb() string. Modern CSS supports space-separated syntax like rgb(6 8 8), but the comma-separated form rgb(6, 8, 8) remains compatible with older browsers. Both formats are derived from the same underlying RGB integers.
When you need to go the other direction, the hex to cmyk converter reverses the process. You can also explore cmyk to rgb if you only need the channel values without the hexadecimal prefix.
Edge cases and rounding
Floating-point arithmetic can introduce tiny errors. A channel that should be exactly 128 might compute as 127.99999999999999. The converter rounds each channel to the nearest integer before formatting the cmyk to hex code, preventing off-by-one mistakes in the final output.
Inputs outside the 0 to 100 range are rejected because ink coverage beyond 100 percent has no physical meaning. Negative percentages are likewise invalid. If you enter a decimal like 33.3, the formula still works correctly and the rounding step handles the fractional pixel value.
Worked examples
| Example | Input | Result |
|---|---|---|
| Pure cyan | Cyan (%): 100; Magenta (%): 0; Yellow (%): 0; Key / Black (%): 0 | HEX: #00FFFF; RGB: 0, 255, 255; CSS rgb(): rgb(0, 255, 255) |
| Rich black | Cyan (%): 60; Magenta (%): 40; Yellow (%): 40; Key / Black (%): 100 | HEX: #000000; RGB: 0, 0, 0; CSS rgb(): rgb(0, 0, 0) |
| Process magenta | Cyan (%): 0; Magenta (%): 100; Yellow (%): 0; Key / Black (%): 0 | HEX: #FF00FF; RGB: 255, 0, 255; CSS rgb(): rgb(255, 0, 255) |
| Warm gray | Cyan (%): 0; Magenta (%): 5; Yellow (%): 10; Key / Black (%): 30 | HEX: #B3AAA1; RGB: 179, 170, 161; CSS rgb(): rgb(179, 170, 161) |
FAQ
What is a CMYK to HEX conversion?
It translates four ink percentages (cyan, magenta, yellow, black) used in printing into a six-character hexadecimal color code used on screens. The math converts CMYK to RGB first, then encodes each channel as two hex digits.
Will the HEX color look exactly the same as the printed CMYK color?
Not always. Monitors emit light while paper reflects it, and different devices have different gamuts. The conversion gives the closest mathematical match, but visual proofing on calibrated equipment is recommended for critical work.
Can I enter decimal percentages like 33.5?
Yes. The converter accepts decimal values between 0 and 100 for each channel. The intermediate RGB calculation uses the exact decimal, and the final RGB integers are rounded to the nearest whole number.
Why does 100% of every CMYK channel not produce pure black on screen?
Mathematically, C=100 M=100 Y=100 K=100 yields RGB 0, 0, 0 which is pure black (#000000). In real printing, 400% total ink coverage causes oversaturation, so printers use rich black formulas with lower CMY values and K=100 instead.
How do I convert the other way, from HEX to CMYK?
Use the hex to cmyk tool on this site. It reverses the process by extracting RGB from the hex code and applying the inverse formula to derive ink percentages.
Is my color data sent to a server?
No. The entire cmyk to hex conversion happens locally in your browser using JavaScript. No network requests are made and no data is stored.