colorcodekit

HEX to CMYK

Paste a hex code and get an approximate CMYK value. For print, confirm with your printer's color profile.

How HEX to CMYK works

Scale RGB to 0–1. Black K = 1 − max(R, G, B). Then C = (1 − R − K) / (1 − K), and the same for M with G and Y with B.

#9CAF88 → K = 31%, C = 11%, M = 0%, Y = 22%. Result: cmyk(11%, 0%, 22%, 31%).

This is a device-independent approximation. Real presses use ICC profiles, so printed results vary.

HEX to CMYK: worked examples

Eight reference colors, converted by the same formulas as the tool above.

ColorHEXCMYKBack to HEX
Red#FF0000cmyk(0%, 100%, 100%, 0%)#FF0000
Black#000000cmyk(0%, 0%, 0%, 100%)#000000
White#FFFFFFcmyk(0%, 0%, 0%, 0%)#FFFFFF
Gray#808080cmyk(0%, 0%, 0%, 50%)#808080
Dodger blue#1E90FFcmyk(88%, 44%, 0%, 0%)#1F8FFF
Gold#FFD700cmyk(0%, 16%, 100%, 0%)#FFD600
Sage#9CAF88cmyk(11%, 0%, 22%, 31%)#9DB089
Vermilion#F54927cmyk(0%, 70%, 84%, 4%)#F54927

CMYK is written with rounded numbers, so converting back does not always return the original. In this table the biggest difference is 1 step in one channel, out of 255.

Things that trip people up

  • This is a formula, not a press result. Pure #FF0000 becomes cmyk(0%, 100%, 100%, 0%) here, but printed magenta plus yellow ink looks duller than a screen's red. A printer's ICC profile accounts for that.
  • CSS does not take cmyk(). The color functions browsers support are hex, rgb(), hsl(), hwb(), lab(), lch(), oklab() and oklch(). Use CMYK values for print files, not stylesheets.
  • Black is one number. #000000 converts to cmyk(0%, 0%, 0%, 100%). Print shops often add cyan, magenta and yellow under black for a richer look; that is a print decision this formula does not make.

Related pages

Frequently asked questions

Is hex to CMYK exact?
No. Screens and presses produce color differently. This formula is a starting point; your printer's ICC profile gives the real values.
Why does K matter?
K (black) replaces equal amounts of cyan, magenta and yellow, which saves ink and prints cleaner darks.

Content updated