Hex to CMYK converter: turn a hex code into CMYK percentages for print
By TechCompare · Updated · How we check
#4F46E5 comes out as cmyk(66%, 69%, 0%, 10%) with the converter's formula. Treat those four percents as a starting point, since mapping between devices accurately takes an ICC profile.
- CMYK
cmyk(66%, 69%, 0%, 10%) - RGB
rgb(79, 70, 229) - HSL
hsl(243, 75%, 59%)
CMYK is the four-ink model used in print: cyan, magenta, yellow and black. Screens mix red, green and blue light, so a hex code like #4F46E5 needs translating before a printer can use it. The converter above does that translation with a simple formula. That formula is quick, but it knows nothing about the inks or paper a printer uses.
How this is calculated
Start by splitting the hex code into red, green and blue. The largest of those three channels sets black, which is called K. The closer that largest channel gets to full, the less black you get. Cyan, magenta and yellow are what's left once the black is taken out. Each of those inks is how far its channel falls short of the largest one, measured as a share of that largest one. The ink that matches the largest channel is therefore always zero. Red's ink is cyan, green's is magenta and blue's is yellow.
Take #4F46E5, which is rgb(79, 70, 229). Blue is the largest channel at 229, so black is 1 minus (229 divided by 255), which rounds to 10%. Yellow is the ink that matches blue, so it's 0%. Cyan is 66% and magenta is 69%.
Turning cmyk(66%, 69%, 0%, 10%) back into hex gives #4E47E6, not #4F46E5, because each percent is rounded to a whole number. Keep the hex code as the master copy. The converter uses no ink, paper or ICC profile. Wikipedia's CMYK article says RGB and CMYK are device-dependent and that no universal formula converts between them, so a printer's profile can give other numbers for the same color. For why screen colors can look different on paper, see RGB vs CMYK.
Verdict
Use these percents for layout, planning and quick comparisons. Before a file goes to print, ask the printer which CMYK profile they use, convert with it and check a printed proof. A simple formula can't show how the printed result will look.
More Color scenarios
Related guides
Frequently asked questions
Will this converter match my design software's CMYK numbers?
Why is black so low for a bright color?
Can I use cmyk() in CSS?
What hex code does 100% cyan give?
Related tools
Contrast Checker
Check color contrast ratios for WCAG AA/AAA accessibility compliance.
Use toolJSON Formatter
Validate, format, and minify JSON. Browse it as a tree, run JSONPath queries, compare two documents, or validate against a JSON Schema.
Use toolAspect Ratio Visualizer
Visually compare width differences between 16:9, 21:9, and 32:9 monitors.
Use tool