How HEX to CMYK conversion works
HEX is a screen colour made of light; CMYK is a recipe for ink on paper. The quick formula below, which this converter and most online tools use, treats ink as the exact opposite of light. It is useful for a first estimate, but a printer converts with an ICC profile for the paper and press, and the table further down shows how far apart the two can be.
- Decode HEX to R, G, B and divide by 255.
- K = 1 − max(R′, G′, B′).
- If K = 1 the colour is pure black: C = M = Y = 0.
- C = (1 − R′ − K) ÷ (1 − K), M = (1 − G′ − K) ÷ (1 − K), Y = (1 − B′ − K) ÷ (1 − K).
- Multiply by 100 and round:
cmyk(C%, M%, Y%, K%).
Worked example: #0D6EFD to CMYK
Here is the converter's own calculation for #0D6EFD, step by step. The result, cmyk(95%, 57%, 0%, 1%), is exactly what the tool above shows for this input.
- Split into pairs: 0D, 6E, FD.
- Red: 0D = 0 × 16 + 13 = 13.
- Green: 6E = 6 × 16 + 14 = 110.
- Blue: FD = 15 × 16 + 13 = 253.
- R′ = 13 ÷ 255 = 0.051, G′ = 0.431, B′ = 0.992.
- K = 1 − max(R′, G′, B′) = 1 − 0.992 = 0.008.
- C = (1 − 0.051 − 0.008) ÷ (1 − 0.008) = 0.949; M = 0.565; Y = 0.
- Rounded to percent:
cmyk(95%, 57%, 0%, 1%).
Bootstrap 5.3 theme colours in HEX and CMYK
Bootstrap's base colour variables.
| Colour | HEX | CMYK |
|---|---|---|
| blue | #0D6EFD | cmyk(95%, 57%, 0%, 1%) |
| indigo | #6610F2 | cmyk(58%, 93%, 0%, 5%) |
| purple | #6F42C1 | cmyk(42%, 66%, 0%, 24%) |
| pink | #D63384 | cmyk(0%, 76%, 38%, 16%) |
| red | #DC3545 | cmyk(0%, 76%, 69%, 14%) |
| orange | #FD7E14 | cmyk(0%, 50%, 92%, 1%) |
| yellow | #FFC107 | cmyk(0%, 24%, 97%, 0%) |
| green | #198754 | cmyk(81%, 0%, 38%, 47%) |
| teal | #20C997 | cmyk(84%, 0%, 25%, 21%) |
| cyan | #0DCAF0 | cmyk(95%, 16%, 0%, 6%) |
| gray-600 | #6C757D | cmyk(14%, 6%, 0%, 51%) |
| gray-900 | #212529 | cmyk(20%, 10%, 0%, 84%) |
Source: Bootstrap 5.3 _variables.scss
Precision test: every HEX value through the converter
Inside the formula, whole-number CMYK is a coarse grid over HEX: all 16,777,216 codes collapse into 2,463,617 CMYK values and only 12.735% come back exactly, never more than 2 levels off. That rounding is tiny compared with the gap between the formula and a real print profile.
Method: every whole-number HEX value, through the converter's own code and back, compared on the 0–255 scale (how we test).
| Measure | Result |
|---|---|
| HEX values tested | 16,777,216 |
| Distinct CMYK results | 2,463,617 |
| Came back exactly | 12.735% |
| Largest change (0–255 levels) | 2 |
| Average change | 0.9311 |
Last updated · Source: Pixohub exhaustive test of lib/color-math.ts
Formula vs a real print profile
Bootstrap's primary blue is a good warning: the formula asks for 95/57/0/1, while the ICC profile asks for 73/45/0/0, because a fully saturated screen blue is outside what CMYK inks can print and the profile maps it to the nearest printable blue. Across these 12 colours the formula's ink values differed from the profile's by up to 64 percentage 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.
| Colour | HEX | Formula C/M/Y/K | Profile C/M/Y/K | Profile total ink |
|---|---|---|---|---|
| blue | #0D6EFD | 95/57/0/1 | 73/45/0/0 | 118% |
| indigo | #6610F2 | 58/93/0/5 | 76/66/0/0 | 142% |
| purple | #6F42C1 | 42/66/0/24 | 73/68/0/0 | 141% |
| pink | #D63384 | 0/76/38/16 | 6/88/6/2 | 102% |
| red | #DC3545 | 0/76/69/14 | 1/91/69/2 | 163% |
| orange | #FD7E14 | 0/50/92/1 | 0/55/85/0 | 140% |
| yellow | #FFC107 | 0/24/97/0 | 0/22/91/0 | 113% |
| green | #198754 | 81/0/38/47 | 82/13/80/11 | 186% |
| teal | #20C997 | 84/0/25/21 | 59/0/46/0 | 105% |
| cyan | #0DCAF0 | 95/16/0/6 | 58/1/2/0 | 61% |
| gray-600 | #6C757D | 14/6/0/51 | 60/46/37/4 | 147% |
| gray-900 | #212529 | 20/10/0/84 | 82/73/64/50 | 269% |
Last updated · Source: Pixohub test, macOS Generic CMYK Profile via LittleCMS
Where you'll use HEX to CMYK
Briefing a printer with a web brand colour
Give the printer the HEX and let them convert with their profile, or ask for a proof. If you must supply CMYK, use values from a profile-based conversion (Photoshop, Affinity or InDesign with the printer's profile), not from a formula.
Quick estimates for drafts
For a home or office printer draft, the formula is fine: those printers take RGB anyway and convert internally. The CMYK numbers help you guess whether a colour will print dull.
Checking whether a colour is printable
Very saturated blues, greens and oranges from the web often fall outside the CMYK gamut. If the profile column below looks noticeably different from the formula, expect the printed colour to look duller than on screen.
Common mistakes
- Sending formula CMYK to a commercial printer as final values: real presses convert through an ICC profile (for example FOGRA39 in Europe or GRACoL in the US), and the numbers differ.
- Expecting black text from #000000 to print as 100% K: through a profile it becomes rich black with four inks (see the RGB to CMYK page), which can blur small text; set body text to 100% K directly in your layout app.
- Ignoring total ink: the formula never exceeds 100% total for a pure colour, but profile conversions of dark colours can reach close to 300%, which matters for drying time on uncoated paper.
- Expecting screen and paper to match: monitors are backlit and paper reflects light, so even a perfect conversion looks different until you view a proof under good light.