A designer hands you a hex code, a CSS file uses rgb notation, a print shop asks for CMYK values, and a dashboard charting library wants HSL — four notations for the same handful of color, and switching between them by hand invites arithmetic mistakes at every step. This tool converts between all of them instantly: type or paste a color in HEX, rgb(), or hsl() form, and it renders the equivalent HEX, RGB, HSL, and CMYK values alongside a live color swatch that updates as you type. Everything runs locally in your browser, free, with no signup and nothing transmitted.
Input is forgiving. You can paste 3498db, #3498DB, rgb(52, 152, 219), or hsl(204, 70%, 53%) and the tool recognizes the format automatically, accepting three-digit hex shorthand and integer or percentage channel values. The swatch removes the last sliver of guesswork: you see the color you landed on before committing it to a stylesheet, a slide deck, or a print order.
Below the converter fields, this page explains what each color model actually measures, why print and screen colors will never match perfectly, and where the rounding rules live — the parts of color conversion that trip people up most often.
The Four Color Models, and What Each One Measures
RGB describes color the way a screen builds it: three channels of red, green, and blue light, each from 0 to 255. Add them all at full strength and you get white; all at zero gives black. It matches how display hardware works, which is why every web color ultimately becomes RGB somewhere in the pipeline.
HEX is RGB in disguise — the same three numbers written as hexadecimal. The channel value 52 is 34 in hex, 152 is 98, and 219 is DB, so rgb(52, 152, 219) and #3498db are byte-identical. Nothing is lost or gained in that conversion; it is pure notation.
HSL describes color the way people talk about it: a hue in degrees around the color wheel (0 red, 120 green, 240 blue), a saturation percentage from gray to vivid, and a lightness percentage from black to white. Designers prefer it because tweaks behave intuitively — keep hue and saturation fixed and raise lightness, and you get a predictable lighter version of the same color, which is exactly how hover states and color scales are built.
CMYK describes color the way a printer applies it: percentages of cyan, magenta, yellow, and black ink layered on white paper. It is subtractive — inks remove light rather than emit it — and its gamut is smaller than any screen's, which is the root of every print-versus-screen disappointment.
How to Use This Tool (Step by Step)
- Paste your color into the input in any of the supported notations — the tool detects the format and parses it, no need to choose a mode.
- Read all four conversions from the result panel, with the live swatch confirming the parsed color visually.
- Copy the format your destination needs: hex for CSS and design files, rgb() for inline styles, hsl() when you plan to derive lighter or darker variants, CMYK when handing off to print.
- Try a three-digit shorthand like #f53 to see it expand to #ff5533 before conversion.
- Adjust values digit by digit and watch the swatch respond — a fast way to learn how each model's axes behave.
Worked Conversion Examples
| HEX | RGB | HSL | CMYK |
|---|---|---|---|
| #3498db | rgb(52, 152, 219) | hsl(204, 70%, 53%) | 76, 31, 0, 14 |
| #e74c3c | rgb(231, 76, 60) | hsl(6, 78%, 57%) | 0, 67, 74, 9 |
| #2ecc71 | rgb(46, 204, 113) | hsl(145, 61%, 49%) | 77, 0, 45, 20 |
| #f1c40f | rgb(241, 196, 15) | hsl(47, 88%, 50%) | 0, 19, 94, 5 |
| #ffffff | rgb(255, 255, 255) | hsl(0, 0%, 100%) | 0, 0, 0, 0 |
| #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) | 0, 0, 0, 100 |
Note the two edge rows: pure white and black sit outside meaningful hue, so HSL assigns them hue 0 by convention, and CMYK writes white as zero ink and black as full black key plate. Different tools show hue 0 versus 360 or omit the hue entirely for grays — both are correct conventions, not conflicts.
The Conversion Formulas, Briefly
HEX to RGB is base conversion: split the six digits into pairs and read each pair as hexadecimal — for #3498db, 34 becomes 52, 98 becomes 152, DB becomes 219. RGB to HSL first computes the maximum and minimum of the three channels; lightness is their midpoint — (max plus min) divided by 2, scaled to 255 — saturation is the spread relative to lightness, and hue comes from which channel dominates, measured in degrees around the wheel. For #3498db: max is 219, min is 52, giving lightness about 53 percent, saturation about 70 percent, and hue at 204 degrees, in the blue sector. HSL back to RGB runs the logic in reverse through three branches depending on which sixth of the wheel the hue occupies.
RGB to CMYK normalizes each channel to 0 through 1, takes the key (black) value as 1 minus the largest channel, then derives the three ink percentages as the leftover difference of each channel over that largest value. For #3498db, the largest channel is 219 (0.859), so K is about 14 percent, cyan is (0.859 minus 0.204) over 0.859, about 76 percent, magenta about 31 percent, and yellow 0 — a color that prints as mostly cyan with a touch of magenta and a moderate black component.
Where Rounding Lives in Color Conversion
Conversions are not perfectly reversible once values are rounded, and knowing where the wobble appears prevents false alarms. RGB values are integers by definition, but HSL and CMYK are typically displayed rounded to whole degrees or percentages. A hue of 204.07 displays as 204; converting hsl(204, 70%, 53%) back to RGB may yield a channel off by one or two from the original, like 51 instead of 52. On a swatch that difference is invisible — a one-part-in-255 change shifts the color by well under a percent — but a pixel-comparison test will flag it. CMYK conversions drift more, because they compose two lossy steps (RGB through a gamut mapping, then to ink percentages) and because paper, ink set, and printing profile change the result in ways no simple formula captures. The values this tool outputs are the standard sRGB-based conversion, which is the right starting point for a print conversation, not the final word.
When CMYK Actually Matters
Screen-only work — websites, apps, video — never needs CMYK; RGB and HSL cover it completely. CMYK enters the picture the moment ink hits paper. Print shops and home printers convert internally, but knowing your CMYK numbers lets you sanity-check the conversion yourself: large areas of rich color built from multiple inks can oversaturate and smudge, so printers prefer total ink coverage below roughly 300 percent — the sum of all four percentages. A navy like #1f3a5f converts to heavy ink loads; your printer may ask for a lighter build. Rich black is another classic: plain 100 percent black alone looks flat on large areas, so print workflows use a build like 60, 40, 40, 100. Small text, conversely, should stay on the black plate only, since four-ink text registers imperfectly and fringes.
Tips and Best Practices
- Design in HSL when you need color scales: fixing hue and saturation while stepping lightness by 10 points produces coherent ramps faster than guessing hex codes.
- Always eyeball the swatch after conversion — a parse surprise is cheaper to catch there than in production CSS.
- Discuss CMYK with your print provider's profile in mind; the same numbers on coated and uncoated stock come out visibly different.
- Keep brand colors defined once in HEX and derive everything else with the tool, rather than maintaining parallel hand-converted values.
- For accessibility, convert to HSL and check that text and background differ by at least 30 lightness points — contrast math starts from those axes.