HEX, RGB, CMYK and Pantone: what each code is for
By Burak. Updated 7 November 2026. About
HEX and RGB describe screen colors: the same three numbers for red, green and blue, written in base 16 or base 10. CMYK describes printing with cyan, magenta, yellow and black ink and depends on the printer. Pantone names specific printed inks. RAL names physical paint and coating colors. Converting between them is exact only from HEX to RGB to HSL; everything else is a nearest match.
One color, five codes
Every code answers a different question. HEX and RGB say how much red, green and blue light a screen should emit. CMYK says how much of four inks a printer should lay down. Pantone and RAL point to a physical reference you can hold: a printed ink swatch or a painted chip.
HEX and RGB
RGB gives each of red, green and blue a value from 0 to 255, so there are 256 × 256 × 256 = 16.7 million possible colors. HEX writes the same three numbers in base 16: #2F6DB5 means red 2F (47), green 6D (109) and blue B5 (181). A short form like #36C means #3366CC.
Web colors are defined in the sRGB color space (IEC 61966-2-1), so a HEX code means the same color on any correctly set up screen. HSL and HSV rewrite the same color as hue, saturation and lightness or value, which is easier for adjusting by hand. Conversions between HEX, RGB, HSL and HSV are exact.
CMYK
Printing works the other way round: ink subtracts light from white paper. Cyan, magenta and yellow absorb red, green and blue light, and black (K) adds depth and sharp text more cheaply than mixing all three.
The simple formula turns RGB into CMYK without knowing anything about the printer. A print shop instead uses an ICC profile for its press and paper, such as FOGRA39 for coated paper in Europe or GRACoL in the US, which gives different numbers for the same color. Use the formula for a rough value and ask the printer for its profile when the color matters. Some screen colors, like bright greens and saturated blues, cannot be printed in CMYK at all.
Pantone
The Pantone Matching System, introduced in 1963, names premixed spot inks: 285 C is a specific blue ink printed on coated paper, 285 U the same ink on uncoated paper, where it looks lighter and duller. Printers mix the ink to a formula instead of building it from CMYK dots, so the color is the same across print runs and suppliers.
Brands use Pantone for logos and packaging. Because Pantone colors are physical inks, their HEX values are screen approximations, and sources disagree by a few units. A converter finds the nearest Pantone by ΔE2000; confirm it with a printed Pantone guide before you print.
Which code for which job
| Code | Made for | Send it to | Converts exactly? |
|---|---|---|---|
| HEX, RGB, HSL | Screens, web and app design | Developers, designers | Yes, between each other |
| CMYK | Printing on paper | Print shops, with their ICC profile | No: depends on press, ink and paper |
| Pantone | Exact printed inks, brand colors | Printers, packaging suppliers | No: nearest match only |
| RAL | Paint, powder coating, plastics | Paint stores, coaters, manufacturers | No: nearest match only |
| Paint brand code | Walls and interiors | Paint stores | No: nearest match only |
A print shop explains the difference
A printer shows the same design in RGB on screen, CMYK on press and Pantone spot ink, and when each one is worth paying for.
A short checklist
- Designing for screens only: keep HEX or RGB, and share HEX.
- Printing a few items: send a CMYK file made with the printer's profile.
- Printing a brand color many times: pick a Pantone and send its code with the file.
- Painting a wall or a metal part: convert to the nearest paint or RAL color and buy a sample.
Questions
Is HEX the same as RGB?
Yes. A HEX code writes the three RGB numbers in base 16, two digits each. #FF0000 is RGB 255, 0, 0.
Why does my print look different from my screen?
Screens make color from light and printers from ink, and some screen colors are outside what CMYK ink can print. Ask the printer for its ICC profile and soft-proof before printing.
How do I find the Pantone for a HEX code?
Use a HEX to Pantone converter. It finds the nearest Pantone ink by ΔE2000 and shows how close it is. Check the result in a printed Pantone guide.
What is the C after a Pantone number?
C means the ink printed on coated paper and U on uncoated paper. The same ink looks lighter and duller on uncoated stock.