Skip to main content

Convert HEX to RGB, HSL & CMYK Color Codes

Convert a HEX, RGB, or HSL color code to HEX, RGB, HSL, and CMYK and copy the CSS values.

Loading tool…

Your file stays in this browser. Nothing is uploaded.

How Color Code Converter (HEX, RGB, HSL, CMYK) works

Browser Toolset Color Code Converter translates a HEX (#ffffff), RGB, or HSL color into HEX, RGB, HSL, and print CMYK values in your browser. CMYK is output only, not an input. Copy each CSS string instantly.

How to use this tool

  1. Paste or type a color code in HEX (3 or 6 digits), RGB, or HSL form, or use the color picker.
  2. The tool automatically detects the input format.
  3. Review the simultaneous conversions to HEX, RGB, RGBA, HSL and CMYK.
  4. Check the color preview, and fix the input if it shows an invalid-color message.
  5. Click "Copy" next to the format you want.

Common uses

  • Developers converting Figma HEX values into CSS rgb() or hsl() notation.
  • Print designers getting a quick CMYK estimate of an on-screen RGB color.
  • Software engineers normalizing color inputs to a single HEX format for storage.
  • Designers checking the RGB channel values behind a HEX or HSL color.

Frequently asked questions

What is the difference between RGB and CMYK?

RGB is an additive model for screens that mixes red, green and blue light, while CMYK is a subtractive ink model used in printing. This tool's CMYK values come from a simple formula, not a printer color profile, so printed colors may differ.

Does it support alpha transparency channels (RGBA, HSLA, 8-digit HEX)?

No. You can type rgba() or hsla(), but the alpha value is ignored and the RGBA output always shows an alpha of 1.0. 8-digit HEX codes are not accepted.

Are my color codes recorded anywhere?

No. The conversions are calculated in your browser and the color codes you type are not uploaded. The tool does not save them, so reloading the page returns to the default color, #2563eb.

What does HSL stand for?

HSL stands for Hue, Saturation and Lightness. Hue is the position on the color wheel from 0 to 360 degrees, and saturation and lightness are percentages. The tool shows them as hsl(h, s%, l%), rounded to whole numbers.

Can I convert named CSS colors like 'rebeccapurple' or 'coral'?

No. Named colors such as rebeccapurple or coral are not recognized. The tool accepts HEX (3 or 6 digits, with or without the #), rgb() and hsl() values, so look up the named color's code and enter that instead.

Details and limits

Designers work in HSL, developers code in HEX, and printers manufacture in CMYK. Bridging these disparate color models requires precise mathematical conversions. Our Color Code Converter turns a HEX, RGB or HSL color into the other formats, plus an on-screen CMYK estimate, in browser memory.

What you can type and what comes out

Conversion happens in your browser as you type, and nothing is uploaded or saved. The page opens on #2563eb. A color swatch next to the text box lets you pick visually, and its choice is written back into the box as a HEX code.

The box reads HEX with 3 or 6 digits, with or without the leading #. It reads rgb() and rgba() with whole numbers from 0 to 255, separated by commas or spaces. It also reads hsl() and hsla() with a hue in degrees, which may be negative or above 360, plus saturation and lightness percentages up to 100. Anything else turns the box red with a message and blanks the results. Five rows then show HEX in capitals, RGB, RGBA, HSL and CMYK, each with a Copy button that is disabled while the input is invalid.

Features and limits

  • Alpha is accepted but ignored. You can type rgba() or hsla() with an alpha value, or the slash form, and the color is read without it. The RGBA row always ends in 1.0. Eight-digit HEX is not recognized.
  • Not accepted as input: CSS color names such as coral, CMYK values, percentages inside rgb() and decimal channel values.
  • HSL and CMYK figures are rounded to whole numbers, so converting back and forth may shift a value by a small amount.
  • CMYK is a plain mathematical conversion from RGB, with black taken as one minus the strongest channel. It uses no ICC profile or ink limits, so it will not match what a given printer produces. Use it as a starting point and ask your printer for a proof.
  • The tool shows one color at a time and keeps no history.

Tips for clean input

Paste the code on its own. Text such as color: #2563eb; or a code with a trailing semicolon is not recognized. Copying from a style sheet usually brings that extra punctuation along.

If your style guide wants lowercase HEX, change the case after copying, since the output is always in capitals.

To sample a color from the screen, use the Color Picker & Palette Inspector. To check whether a converted pair of colors is readable together, open the WCAG Color Contrast Checker, which expects HEX input.