RGB to CMYK Converter

RGB to CMYK: rgb(128, 0, 128) = cmyk(0%, 100%, 0%, 50%). See the formula worked step by step, a reference table, and our test of every RGB value.

How to use RGB to CMYK

  1. 1Enter an RGB colour.
  2. 2Read the formula's C, M, Y and K.
  3. 3Check the profile table to see how a colour-managed conversion differs.

Features

  • Naive formula with every intermediate value
  • 16 basic HTML colours through a real print profile
  • Rich-black and total-ink figures

How RGB to CMYK conversion works

The textbook RGB to CMYK formula takes black (K) from how dark the colour is, then works out how much cyan, magenta and yellow are needed to subtract the remaining light. It ignores the paper, the inks and how they overlap, which is exactly what an ICC profile describes, so treat the result as a starting point.

  • R′, G′, B′ = channel ÷ 255.
  • K = 1 − max(R′, G′, B′).
  • C = (1 − R′ − K) ÷ (1 − K); M = (1 − G′ − K) ÷ (1 − K); Y = (1 − B′ − K) ÷ (1 − K).
  • When K = 1 (pure black), C = M = Y = 0.
  • Multiply each by 100 and round.

Worked example: rgb(128, 0, 128) to CMYK

Here is the converter's own calculation for rgb(128, 0, 128), step by step. The result, cmyk(0%, 100%, 0%, 50%), is exactly what the tool above shows for this input.

  • R′ = 128 ÷ 255 = 0.502, G′ = 0, B′ = 0.502.
  • K = 1 − max(R′, G′, B′) = 1 − 0.502 = 0.498.
  • C = (1 − 0.502 − 0.498) ÷ (1 − 0.498) = 0; M = 1; Y = 0.
  • Rounded to percent: cmyk(0%, 100%, 0%, 50%).

The 16 basic HTML colours in RGB and CMYK

The original sixteen colour keywords from HTML 4, still valid CSS named colours.

ColourRGBCMYK
blackrgb(0, 0, 0)cmyk(0%, 0%, 0%, 100%)
silverrgb(192, 192, 192)cmyk(0%, 0%, 0%, 25%)
grayrgb(128, 128, 128)cmyk(0%, 0%, 0%, 50%)
whitergb(255, 255, 255)cmyk(0%, 0%, 0%, 0%)
maroonrgb(128, 0, 0)cmyk(0%, 100%, 100%, 50%)
redrgb(255, 0, 0)cmyk(0%, 100%, 100%, 0%)
purplergb(128, 0, 128)cmyk(0%, 100%, 0%, 50%)
fuchsiargb(255, 0, 255)cmyk(0%, 100%, 0%, 0%)
greenrgb(0, 128, 0)cmyk(100%, 0%, 100%, 50%)
limergb(0, 255, 0)cmyk(100%, 0%, 100%, 0%)
olivergb(128, 128, 0)cmyk(0%, 0%, 100%, 50%)
yellowrgb(255, 255, 0)cmyk(0%, 0%, 100%, 0%)
navyrgb(0, 0, 128)cmyk(100%, 100%, 0%, 50%)
bluergb(0, 0, 255)cmyk(100%, 100%, 0%, 0%)
tealrgb(0, 128, 128)cmyk(100%, 0%, 0%, 50%)
aquargb(0, 255, 255)cmyk(100%, 0%, 0%, 0%)

Source: W3C CSS Color Module Level 4

Precision test: every RGB value through the converter

Within the formula, whole-number CMYK maps all 16,777,216 RGB colours onto 2,463,617 ink recipes, and 12.735% of colours come back exactly, never more than 2 levels off. The bigger story is in the next table.

Method: every whole-number RGB value, through the converter's own code and back, compared on the 0–255 scale (how we test).

MeasureResult
RGB values tested16,777,216
Distinct CMYK results2,463,617
Came back exactly12.735%
Largest change (0–255 levels)2
Average change0.9311

Last updated · Source: Pixohub exhaustive test of lib/color-math.ts

Formula vs a real print profile

The 16 basic HTML colours show the formula's blind spots. Black is 0/0/0/100 by formula but 75/71/65/80 through the profile: a rich black of 291% total ink, because the profile adds cyan, magenta and yellow under the black for a deeper result. Across these colours the two methods differed by up to 75 points on a single ink.

The converter above uses the standard formula. To show what a colour-managed conversion does, we converted the same colours with LittleCMS 2.19 through the Generic CMYK profile that ships with macOS (relative colorimetric intent with black point compensation, the default in Photoshop). Your printer's profile will give different numbers again, but in the same direction.

ColourHEXFormula C/M/Y/KProfile C/M/Y/KProfile total ink
black#0000000/0/0/10075/71/65/80291%
silver#C0C0C00/0/0/2522/17/15/054%
gray#8080800/0/0/5050/43/39/2134%
white#FFFFFF0/0/0/00/0/0/00%
maroon#8000000/100/100/5014/90/93/38235%
red#FF00000/100/100/00/84/93/1178%
purple#8000800/100/0/5054/98/1/4157%
fuchsia#FF00FF0/100/0/031/59/0/090%
green#008000100/0/100/5069/8/98/25200%
lime#00FF00100/0/100/041/0/60/0101%
olive#8080000/0/100/5024/16/96/32168%
yellow#FFFF000/0/100/06/0/69/075%
navy#000080100/100/0/5097/83/7/21208%
blue#0000FF100/100/0/087/67/0/0154%
teal#008080100/0/0/5084/19/39/13155%
aqua#00FFFF100/0/0/039/0/14/053%

Last updated · Source: Pixohub test, macOS Generic CMYK Profile via LittleCMS

Where you'll use RGB to CMYK

Preparing artwork for offset printing

Convert in your layout application using the printer's profile and check the result in a soft-proof. Use this page to understand roughly what will happen, not as final separations.

Estimating ink-heavy designs

Dark backgrounds converted through a profile can carry close to 300% ink. If you're printing on uncoated paper, ask the printer for their total ink limit before converting.

Matching a spot colour

If a brand colour must be exact in print, specify a spot ink from a physical swatch book rather than a CMYK build; CMYK can only approximate many saturated colours.

Common mistakes

  • Sending small black text as converted rich black: four plates must line up perfectly, so text can look fuzzy. Use 100% K for text.
  • Using registration black (100/100/100/100) as a design colour: 400% ink smears and won't dry properly.
  • Converting an image to CMYK several times with different tools: each conversion clips colours, and the losses add up.
  • Judging the printed colour on an uncalibrated screen; use a hard proof for anything colour-critical.

Frequently asked questions

Why does black become four inks in Photoshop?

Photoshop converts through an ICC profile, which builds a richer black with cyan, magenta and yellow underneath. In our test the macOS Generic CMYK profile turned rgb(0, 0, 0) into 75/71/65/80; the naive formula gives 0/0/0/100.

What is rgb(128, 0, 128) in CMYK?

By formula, cmyk(0%, 100%, 0%, 50%). Through the macOS Generic CMYK profile it becomes 54/98/1/4: almost no black, with cyan doing most of the darkening. The table on this page shows all 16 basic colours both ways.

Which is right, the formula or the profile?

The profile, for a specific paper and press. The formula has no idea what press you're printing on, which is why printers ask for RGB or for files converted with their own profile.

Does converting to CMYK lose colours?

Yes. CMYK can't reproduce the most saturated screen colours, and both the formula and profiles have to clip or compress them.

More text, code & dev tools