Convert any hex color to CMYK in one click
Paste a hex color code and get the exact CMYK values you need for print — cyan, magenta, yellow, and black — instantly, right in your browser. No uploads, no sign-up, no waiting.
Your color data never leaves your device. Everything runs locally in the browser, so it stays completely private.
How to use the hex to CMYK converter
- Type or paste your hex code into the input field above (e.g.
#E63946). The # is optional. - The tool instantly shows a live color swatch so you can confirm it's the right shade.
- Copy the CMYK values directly from the result panel — or grab the color in any other format shown (RGB, HSL, HSV) at the same time.
Worked example: hex to CMYK conversion
Suppose your brand color is #1D3557 — a deep navy blue used in a logo.
| Format | Value |
|---|---|
| Hex input | #1D3557 |
| Red channel (R) | 29 |
| Green channel (G) | 53 |
| Blue channel (B) | 87 |
| CMYK output | C: 67% M: 39% Y: 0% K: 66% |
What those channels mean: C (Cyan), M (Magenta), and Y (Yellow) are the ink colors mixed together, while K (Key / Black) is added to deepen shadows and sharpen text. Together they describe exactly how much of each ink a printer lays down to reproduce your color on paper.
The tool also shows the color in RGB, HSL, and HSV at the same time, so you can copy whichever format your workflow needs next.
How to convert hex to CMYK in code
If you need to automate this in a project, here are working snippets for the two most common languages.
Python
def hex_to_cmyk(hex_color):
hex_color = hex_color.lstrip('#')
r, g, b = (int(hex_color[i:i+2], 16) / 255 for i in (0, 2, 4))
k = 1 - max(r, g, b)
if k == 1:
return (0, 0, 0, 100) # pure black
c = (1 - r - k) / (1 - k)
m = (1 - g - k) / (1 - k)
y = (1 - b - k) / (1 - k)
return tuple(round(v * 100) for v in (c, m, y, k))
print(hex_to_cmyk('#1D3557')) # (67, 39, 0, 66)
JavaScript
function hexToCmyk(hex) {
hex = hex.replace('#', '');
const r = parseInt(hex.slice(0, 2), 16) / 255;
const g = parseInt(hex.slice(2, 4), 16) / 255;
const b = parseInt(hex.slice(4, 6), 16) / 255;
const k = 1 - Math.max(r, g, b);
if (k === 1) return { c: 0, m: 0, y: 0, k: 100 };
return {
c: Math.round(((1 - r - k) / (1 - k)) * 100),
m: Math.round(((1 - g - k) / (1 - k)) * 100),
y: Math.round(((1 - b - k) / (1 - k)) * 100),
k: Math.round(k * 100)
};
}
console.log(hexToCmyk('#1D3557')); // { c: 67, m: 39, y: 0, k: 66 }
How it works
A hex color (like #1D3557) is just a compact way to write three RGB values in base-16. The tool first splits the hex string into its red, green, and blue components and converts each to a 0–1 decimal.
From there, the K (black) value is calculated as 1 − max(R, G, B). The C, M, and Y values are then derived by subtracting K from each channel. The CSS Color Level 4 spec covers color space definitions and how these conversions relate to screen rendering.
One important note: this is a mathematical conversion, not a profile-based one. For production print work, a professional color management tool using ICC profiles (like Adobe Photoshop or Illustrator) will give more accurate ink-on-paper results for a specific press and paper stock.
When to use hex to CMYK — and when not to
Good uses
- Getting a starting CMYK estimate for a brand color before sending assets to a print shop.
- Translating a web palette into print-ready values for a brochure, business card, or poster.
- Quickly checking what ink mix a designer's hex swatch corresponds to.
- Generating CMYK values programmatically in a design tool plugin or build script.
When to be careful
- Professional print production: Always confirm final values with a color-managed workflow (ICC profiles). Mathematical CMYK can look different from press output.
- Spot colors: Pantone and other proprietary spot colors can't be reliably derived from hex. Use the Pantone Color Bridge guide for those.
- Wide-gamut displays: Some vivid RGB colors (neon greens, electric blues) fall outside the CMYK gamut — they'll look duller in print than on screen.
Drop your hex code into the converter above and get your CMYK breakdown in seconds — no account needed, completely free.