Hex to RGB to CMYK Multi-Converter

Input one of these color code boxes and click “Calculate” to instantly get your result:

Hex:
 
RGB:
 
CMYK:
 

How It Works

CMYK to RGB

CMYK color model is a subtractive model, while RGB is an additive model. Because the CMYK uses percentages to stand for C, M, Y, and K values, we can subtract them by 1 to get the inverse RGB values. Therefore, we can go through this process to convert CMYK to RGB codes:

  1. Conversion Formula: When converting CMYK values to RGB, the formula provided can be understood as:
    • R = 255 * (1 – C) * (1 – K)
    • G = 255 * (1 – M) * (1 – K)
    • B = 255 * (1 – Y) * (1 – K)

The multiplication by 255 scales the value to the RGB range, which is 0-255.

(1 – C) calculates the inverse of the Cyan value, as RGB requires the amount of Red which is opposite to Cyan.

(1 – K) represents the lack of black. The more black (K) you have, the darker the color will be. Hence, we subtract it.

  1. Rounding: Since RGB values must be integers between 0 and 255, the results are rounded to the nearest whole number.

RGB to Hex

Converting RGB code (Red, Green, Blue) to Hex involves converting decimals to hexadecimal forms.

Take the Red value 255 as an example and divide it by 16:

  1. Divide by 16: Take the decimal RGB value and divide it by 16. 255/16 equals 15.93.
  2. Whole Number: Take the whole number from the division. In this case, the whole number from 15.93 is 15.
  3. Remainder: Find the remainder and map to its hexadecimal equivalent. For this example, 255-15×16=15, and 15 is the F in the hexadecimal number system.
  4. Continue to Divide the Quotient by 16: Remember the whole number (quotient) we got from Step 2? Divide it by 16, and repeat steps 1 to 3 until the quotient is less than 16. Specifically, in our scenario, we got the quotient number 15 from Step 2. 15 is less than 16, so we do not need to divide it by 16 but directly use it as a remainder. 15 is F in the hexadecimal system. Here we got another F.
  5. Concatenate: Finally, we need to concatenate all the hexadecimal numbers we got from the previous steps. Remember, the concatenation should be in reverse order, which means the last acquired number should be at the first. In our case, we got two F’s, so we don’t need to care about order. The red value of 255 in decimal is just FF in hexadecimal.
RGB to Hex: Convert Decimal to Hexadecimal - 255 as example

Feeling dizzy? Let’s take a little practice to understand this mechanism more easily. (Of course, you can always use our all-in-one tool to save your time!) We have derived FF from the R-value of the RGB code. Now try the last two of (255, 87, 51)! Can you convert 87 and 51 back to Hex?

RGB to Hex: Convert Decimal to Hexadecimal - 87 as example
RGB to Hex: Convert Decimal to Hexadecimal - 51 as example

Following the same steps above, we can get the hexadecimal numbers of Green and Blue, which are 57 and 33. Put them in the order of R, G, B, and we have gotten the hex code of (255, 87, 51), which is FF5733.

CMYK to Hex

After you get the two methods above, converting CMYK to hex codes will become pretty easy. First, you convert CMYK to RGB, then RGB to Hex. Here’s a simplified outline:

  1. CMYK to RGB:
    • Red = 255 × (1-C) × (1-K)
    • Green = 255 × (1-M) × (1-K)
    • Blue = 255 × (1-Y) × (1-K)
  2. RGB to Hex:
    • Convert the Red, Green, and Blue values to hexadecimal.
    • Concatenate the three two-digit values of the red, green, and blue in the order of RRGGBB.

Hex to RGB

Hex to RGB code conversion is pretty easy with the following steps:

  1. Take the Hex Code: For example, #FF5733.
  2. Split the Code: Divide it into three pairs: FF, 57, and 33. Each of these three pairs corresponds to R, G, and B values in the RBG codes.
  3. Convert to Decimal: Next, convert each pair from hexadecimal to decimal. Hexadecimal numbers use a base-16 system, which includes the digits 0-9 and the letters A-F. Take the pair “FF” as an example. F is 15 in decimal. The first F represents F×161, and the second F represents F×160. Therefore, FF equals 15×161+ 15×160=255 in decimal.

Similarly, 57 equals 5×161+ 7×160=87 and 33 equals 3×161+ 3×160=51.

  1. Get the RGB: At the end, we get the R-value as 255, G as 87, and B as 51. So, the conversion result is (255, 87, 51).

RGB to CMYK

Converting RGB to CMYK also involves a specific formula. In the RGB model, Red, Green, and Blue values are expressed in a 0-255 range.

  1. Normalization: For conversion, you first normalize RGB values by dividing each by 255. The formula for CMYK values is as follows:
    • C = (1 – R/255)
    • M = (1 – G/255)
    • Y = (1 – B/255)
    • K = min (C, M, Y)
  1. Adjust CMY Values: After finding K, adjust the C, M, and Y values using this formula:
    • C = (C−K) / (1−K)
    • M = (M−K) / (1−K)
    • Y = (Y−K) / (1−K)

Here, K represents the black value. It’s the minimum among the inverse RGB values, ensuring the darkest color possible. Then, you refine C, M, and Y to reflect the absence of black.

  1. Rounding: Finally, multiply all values by 100 to convert them to percentages. Make sure to round to the nearest whole number, as CMYK often uses integer values.

Hex to CMYK

Similar to converting CMYK to Hex, we can convert Hex to CMYK by changing the Hex code to RGB first, and then RGB to CMYK. Simplified steps are:

  1. Hex to RGB: First, you’ll need to convert the Hex value to RGB. Hex values represent colors in a base-16 format. For example, #FF5733. The first two characters after the hash represent Red, the next two for Green, and the last two for Blue. Convert them into decimal:
    • Red = FF (Hex) = 255 (Decimal)
    • Green = 57 (Hex) = 87 (Decimal)
    • Blue = 33 (Hex) = 51 (Decimal)
  2. RGB to CMYK: Next, convert RGB to CMYK using these formulas we wrote before:
    • Temp C = (1 – R/255) * 100
    • Temp M = (1 – G/255) * 100
    • Temp Y = (1 – B/255) * 100
    • K = min (Temp C, Temp M, Temp Y)
    • C = (Temp C – K) / (1 – K)
    • M = (Temp M – K) / (1 – K)
    • Y = (Temp Y – K) / (1 – K)

There you have it. You’ve successfully converted Hex to CMYK!

Other Related Tools

Get Latest Asian Trends

Discover the secrets of Asian & US fashion trends✨

Subscribe to our weekly newsletter and unlock:

  • Exclusive fashion insights from US, Japan, Korea, and China
  • A journey through historical fashion trends
  • Shopping tips to snag the best deals on stylish outfits