CMYK to HEX Converter

red C 100% 255 × (1 − 1) × (1 − 0.25) = 0 00
green M 50% 255 × (1 − 0.5) × (1 − 0.25) = 95.625 ≈ 96 60
blue Y 0% 255 × (1 − 0) × (1 − 0.25) = 191.25 ≈ 191 BF

#0060BF

A colour worked out from CMYK by formula is an estimate, not how the inks will print: with no ICC profile the conversion knows nothing about the inks, dot gain or the RGB space, and CSS Color 5 warns such an estimate can be visually very far from the printed result. A hex code sent back to CMYK can also return different inks, because the formula chooses black itself.

Going the other way? Convert a hex code back to CMYK inks

How to convert CMYK to HEX code?

CMYK inks become a hex colour code in two moves: cmyk(100%, 50%, 0%, 25%) is #0060BF. Work out each channel with the CMYK to RGB formula and round it, then write each whole number as two hex digits.

  1. Type the four inks into the box, with or without % signs: cmyk(100%, 50%, 0%, 25%) and 100 50 0 25 both read.
  2. Work out each channel as 255 × (1 − ink) × (1 − K): green is 255 × 0.5 × 0.75 = 95.625.
  3. Round each channel to a whole number, a value exactly halfway rounding up, so 95.625 becomes 96.
  4. Write each channel as two uppercase hex digits and join them behind a #: 0, 96 and 191 give #0060BF.
  5. Copy the code, or swap the direction to turn a hex code back into inks.

This hex code is the naive reading of an ink mix, not a measured colour; the guide to what CMYK is explains why the two can differ.

Cyan Ink Percentages as Hex Codes

One ink on its own traces a line of tints. Cyan takes only the red pair down, 25.5 levels at a time, so every other row lands halfway and shows where rounding decides the pair.

Cyan Ink Percentages as Hex Codes
CMYKHex code
cmyk(10%, 0%, 0%, 0%)#E6FFFF
cmyk(20%, 0%, 0%, 0%)#CCFFFF
cmyk(30%, 0%, 0%, 0%)#B3FFFF
cmyk(40%, 0%, 0%, 0%)#99FFFF
cmyk(50%, 0%, 0%, 0%)#80FFFF
cmyk(60%, 0%, 0%, 0%)#66FFFF
cmyk(70%, 0%, 0%, 0%)#4DFFFF
cmyk(80%, 0%, 0%, 0%)#33FFFF
cmyk(90%, 0%, 0%, 0%)#1AFFFF
cmyk(100%, 0%, 0%, 0%)#00FFFF

Worked Example: cmyk(100%, 50%, 0%, 25%) to HEX

cmyk(100%, 50%, 0%, 25%) rounds two of its three channels before they become pairs. The working gives each channel before rounding, the pair it becomes, and the colour beside the result.

red C 100% 255 × (1 − 1) × (1 − 0.25) = 0 00
green M 50% 255 × (1 − 0.5) × (1 − 0.25) = 95.625 ≈ 96 60
blue Y 0% 255 × (1 − 0) × (1 − 0.25) = 191.25 ≈ 191 BF

#0060BF

Result: cmyk(100%, 50%, 0%, 25%) = #0060BF

Joined behind a #, the three pairs give #0060BF. Sent back through the inverse formula it returns cmyk(100%, 50%, 0%, 25%), the inks this example started from. That is not guaranteed, because the formula chooses black itself and rounds every channel.

  • cmyk(100%, 50%, 0%, 25%) as a hex colour code: #0060BF

Check it in reverse

To check the result, read the hex code back as ink percentages; expect the numbers to come back close, not always identical.

Worked examples: CMYK to HEX

Each example gives the value first, then the working. Select a value to load it in the converter.

What is cmyk(100%, 50%, 0%, 25%) in hex?

cmyk(100%, 50%, 0%, 25%) comes out as #0060BF.

The channels 0, 95.625, 191.25 round and become the pairs 00, 60, BF.

Load this value in the converter

What is cmyk(0%, 100%, 0%, 0%) in hex?

cmyk(0%, 100%, 0%, 0%) comes out as #FF00FF.

With no black, red and blue stay at 255 while full magenta takes green to 0: the pairs FF, 00, FF.

Load this value in the converter

Every example above converts back through the inverse formula — take the same hex codes back to CMYK — but the inks that return can differ, because the formula chooses K itself.

What the Hex Result Carries

Below are the rules this page follows, in the wording the site uses everywhere. The formula is stated in full, and the page rounds every channel before it writes a pair.

Different ink mixes can give the same hex code: cmyk(0%, 0%, 0%, 100%) and cmyk(100%, 100%, 100%, 0%) both come out as #000000.

iToolHub rounds each channel to a whole number before writing it as two uppercase hex digits behind a #, so 229.5 becomes 230, which is E6.

To convert CMYK to RGB by formula, write each ink as a fraction from 0 to 1; then R = 255 × (1 − C) × (1 − K), G = 255 × (1 − M) × (1 − K) and B = 255 × (1 − Y) × (1 − K), each rounded to a whole number.

What Happens Between the Inks and the Hex Code?

Rounding Before the Pair

A hex pair can only hold a whole number, so the channel is rounded first: 229.5 becomes 230, which is E6. The fraction is gone at that point, and no hex code can carry it.

Different Mixes, One Code

Different ink mixes can give the same hex code: cmyk(0%, 0%, 0%, 100%) and cmyk(100%, 100%, 100%, 0%) both come out as #000000. So a hex code cannot say which inks made it, and converting it back gives the formula's own choice.

Profiles Give Other Codes

CSS Color 5 sends the same 0% 70% 20% 0% through a FOGRA39 profile and through a SWOP profile and gets two different colours. The formula answer is a third, which is why design software may show a different code.

Common Mistakes

  • Writing a channel that is not a whole number as a pair. 95.625 has no hex form, so it is rounded to 96 first.
  • Forgetting that black scales all three channels. With K at 25%, even a channel with no ink tops out at 191, which is BF.
  • Expecting the same inks back from the hex code. Several mixes give one code, and the formula picks only one of them on the way back.
  • Pasting a hex code into this box. It reads CMYK inks, and a hex code goes the other way.

Frequently Asked Questions

Is CMYK the same as HEX?

No. A hex colour code writes three RGB channels as pairs of hexadecimal digits for a screen; CMYK is four ink amounts for print. This page goes from one to the other through the formula, which is an estimate rather than a print profile conversion.

Why does design software show a different hex code for the same CMYK?

Design software can convert CMYK through a colour profile for a particular press, and CSS Color 5 shows two profiles turning the same inks into two different colours. The formula here uses none, and converting its code back need not return your inks.

How do I convert color codes into HEX?

It depends on the notation. CMYK inks go through the formula to three channels, which are rounded and written as pairs, as on this page. An rgb() value skips the formula: each channel is written as two hex digits straight away.

Yes, in the HEX to CMYK direction, though the inks that come back can differ from the ones you started with.

The rest of the family sits on the colour notation converters.