StringMash.com

Hex to CMYK converter

Hex colour codes to print ink percentages, with the working.

Conversion
7 characters
Updates as you type
Hex#FF8800
RGBrgb(255, 136, 0)
HSLhsl(32, 100%, 50%)
CMYKcmyk(0%, 47%, 100%, 0%)
Nearest CSS namedarkorange
Contrast with white2.39:1 (fails)
Contrast with black8.77:1 (AAA)
The swatch and working are below

Show the steps
Aa blackAa white
  1. Split the code into pairs: FF 88 00. Each pair is a number from 00 to FF, which is 0 to 255.
  2. Red: FF = 15 × 16 + 15 = 255.
  3. Green: 88 = 8 × 16 + 8 = 136.
  4. Blue: 00 = 0 × 16 + 0 = 0.
  5. Divide each channel by 255: red 1, green 0.533, blue 0.
  6. Black (K) is 1 minus the largest of those: 1 − 1 = 0, so 0%.
  7. Each colour ink is (1 − channel − K) ÷ (1 − K). Cyan = (1 − 1 − 0) ÷ 1 = 0, so 0%.
  8. Magenta from green: 0.467, so 47%. Yellow from blue: 1, so 100%.
  9. This is the plain screen formula. A print shop converts with its own colour profile, so the inks it uses will differ a little.
  10. Contrast: 2.39:1 against white and 8.77:1 against black, so black text reads better on it.

Using the converter

Paste a hex code such as #FF8800, with or without the #. The CMYK values appear as you type, as whole percentages ready for a print form, and the working below shows how each one was found.

The box also takes rgb(), hsl() and CSS names like teal, so you can start from whatever you have. Nothing you type leaves the page.

How the conversion works

First the hex code becomes three numbers from 0 to 255, two hex digits each. Divide each by 255 so it runs from 0 to 1. Black is 1 minus the largest of the three, so a colour with a channel at full needs no black at all.

Each ink is then (1 − channel − black) ÷ (1 − black). For #FF8800, red is 1, green 0.533 and blue 0. Black is 0, cyan is 0, magenta is 1 − 0.533 = 0.467 and yellow is 1, so cmyk(0%, 47%, 100%, 0%).

Why the printer may not match

Screens make colour by adding light. Printers take it away, laying four inks over white paper. The two can't reach all the same colours, so a bright screen orange or electric blue often prints duller.

The formula here is the simple one that knows nothing about your paper or press. It is the "naive" conversion the CSS Color specification describes for colours without a profile. A print shop uses an ICC colour profile for its own press instead, and the numbers it picks will differ a little, especially in deep blacks. Use these values as a starting point, and ask the printer for a proof when the colour really matters.

What the K means

K is black. Printers call the black plate the key plate, because it carries the fine detail and text the other colours line up to. Black ink is used instead of mixing all three colours because a mix of the three colour inks comes out a muddy brown, uses three times the ink and takes longer to dry.

Questions

What is #000000 in CMYK?

cmyk(0%, 0%, 0%, 100%), black ink only. Printers sometimes add other inks under it for a deeper "rich black", but that comes from their profile, not this formula.

What is #FFFFFF in CMYK?

cmyk(0%, 0%, 0%, 0%), no ink at all. White comes from the paper.

Can I convert back?

Yes. Swap the boxes, or use the [CMYK to hex](/cmyk-to-hex) page.

Sources

Added and reviewed . What's new