🎨

Color Converter

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Other Tools
—
HEX
—
RGB
—
HSL
—
CMYK

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)

  1. 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.
  2. Read all four conversions from the result panel, with the live swatch confirming the parsed color visually.
  3. 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.
  4. Try a three-digit shorthand like #f53 to see it expand to #ff5533 before conversion.
  5. Adjust values digit by digit and watch the swatch respond — a fast way to learn how each model's axes behave.

Worked Conversion Examples

HEXRGBHSLCMYK
#3498dbrgb(52, 152, 219)hsl(204, 70%, 53%)76, 31, 0, 14
#e74c3crgb(231, 76, 60)hsl(6, 78%, 57%)0, 67, 74, 9
#2ecc71rgb(46, 204, 113)hsl(145, 61%, 49%)77, 0, 45, 20
#f1c40frgb(241, 196, 15)hsl(47, 88%, 50%)0, 19, 94, 5
#ffffffrgb(255, 255, 255)hsl(0, 0%, 100%)0, 0, 0, 0
#000000rgb(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.

Frequently Asked Questions

How do I convert a HEX color code to RGB?
Split the six hex digits into three pairs and convert each pair from hexadecimal to decimal. For #3498db: 34 becomes 52, 98 becomes 152, and DB becomes 219, giving rgb(52, 152, 219). Three-digit shorthand works too — #f53 expands to ff5533 first. Or skip the arithmetic entirely: paste the code into this tool and it returns the RGB value instantly, alongside HSL and CMYK equivalents and a live swatch so you can visually confirm the parsed color matches what you intended.
What is the difference between RGB and CMYK?
RGB is additive and screen-based: colored light combines, and full-strength red, green, and blue together produce white. CMYK is subtractive and ink-based: cyan, magenta, yellow, and black inks absorb light on white paper, and more ink means darker. RGB's gamut is much larger — vivid screen colors like pure orange and electric blue simply cannot be reproduced with ink, which is why printed work often looks duller than the design. Use RGB or HEX for anything displayed on screens, and CMYK values when handing off to a print provider.
Why do my printed colors look different from the screen?
Two physical reasons. First, the gamut gap: screens emit light and cover a wider range of colors than ink on paper can absorb, so saturated colors get compressed toward duller equivalents during conversion. Second, paper and lighting: the same CMYK numbers on glossy coated stock versus rough uncoated paper produce visibly different results, and fluorescent office lighting shifts perception further. For predictable results, ask your print shop which ICC profile they use and preview a proof; the tool's CMYK output is the correct sRGB-based starting point for that conversation.
What does HSL mean and when should I use it?
HSL stands for hue, saturation, lightness: hue is the color's position in degrees on the wheel — 0 red, 120 green, 240 blue — saturation is its intensity from gray to vivid as a percentage, and lightness runs from black at 0 percent to white at 100 percent. Use it whenever you want intuitive adjustments: keeping hue and saturation fixed while raising lightness yields predictable hover states, and stepping lightness in even increments builds coherent color scales. CSS supports it natively as hsl(204, 70%, 53%), and this tool converts to and from it in both directions.
Can I convert CMYK to HEX and get the exact same color?
Only approximately. Converting CMYK to RGB assumes a specific ink and paper profile, and since the ink gamut is smaller than the screen gamut, the result is a best-effort match rather than an exact one — the same CMYK values translate to different RGB under coated versus uncoated profile assumptions. Simple formula-based conversion, which this tool uses, gives the standard sRGB approximation that is fine for mockups and CSS work. For brand-critical print matching, request a physical proof from the printer rather than trusting any automatic conversion.
Why does white convert to CMYK 0,0,0,0 but black to 0,0,0,100?
Because CMYK describes ink on white paper. White paper already looks white, so white needs zero ink of any kind — hence 0, 0, 0, 0. Black requires the key (black) plate at 100 percent with no colored inks. Screen models work the opposite way: RGB white is 255, 255, 255 because all three light channels fire at full strength, and black is all channels at zero. The mental flip — light adds, ink subtracts — explains most surprises when converting between the two families, including why saturated screen colors become muted ink builds.

Related Tools