Design & Visuals

Free Online Color Converter

HEX, RGB, HSL, and CMYK color conversion suite with live preview.

Loading Utility…

Color Converter Guide · 5 min read

Color Converter Guide: HEX, RGB, HSL, HSB & CMYK Explained

Color appears in a different format in every tool — HEX in CSS, RGB in JavaScript, CMYK in print, HSL in design systems, HSB in Adobe apps. Our Color Converter translates between all major color models instantly, so you're never stuck hunting for the right formula.

Why Different Color Models Exist

Colors are represented differently depending on the medium:

  • Screen/light: Additive color mixing (RGB) — red + green + blue = white
  • Print/ink: Subtractive color mixing (CMYK) — inks absorb light
  • Human intuition: HSL/HSB — describes colors by hue, saturation, lightness in terms we naturally think in

A color that looks perfect on screen may print completely differently — screens emit light while print reflects it.

HEX — Web Standard

Six-character hex strings representing RGB values:

#3b82f6 = R:59, G:130, B:246
color: #3b82f6;          /* Standard 6-character */
color: #38f;             /* 3-character shorthand (#3388ff) */
color: #3b82f6cc;        /* 8-character with alpha (CC = 80% opacity) */

HEX is the most common format in CSS and design tools. Compact, copy-paste friendly, and universally understood.

RGB — Additive Color Model

color: rgb(59, 130, 246);           /* 0–255 per channel */
color: rgba(59, 130, 246, 0.8);     /* With 0–1 alpha */

rgb(0, 0, 0) = black, rgb(255, 255, 255) = white.

Use RGB for: JavaScript color manipulation (canvas, WebGL, Three.js), CSS when computing dynamic values, color interpolation in animations.

HSL — Human-Friendly

color: hsl(217, 91%, 60%);
/* Hue: 217° (blue), Saturation: 91%, Lightness: 60% */
Component Range Meaning
Hue 0–360° Color wheel position (0° = red, 120° = green, 240° = blue)
Saturation 0–100% Color intensity (0% = gray)
Lightness 0–100% Brightness (0% = black, 50% = full color, 100% = white)

Why HSL is powerful for design systems:

/* Generate a full tonal scale by only changing lightness */
--primary-900: hsl(217, 91%, 20%);
--primary-700: hsl(217, 91%, 40%);
--primary-500: hsl(217, 91%, 60%);  /* Base */
--primary-300: hsl(217, 91%, 75%);
--primary-100: hsl(217, 91%, 92%);

Same hue and saturation, only lightness changes — coherent palette automatically. This is how Tailwind, Radix, and shadcn generate their color scales.

HSB / HSV — Design Tool Model

Used in Adobe Photoshop, Illustrator, Figma, Sketch:

Component Range Notes
Hue 0–360° Same as HSL
Saturation 0–100% Color purity
Brightness 0–100% Light amount (100% with 0% saturation = white)

HSB differs from HSL in how lightness and saturation interact. When you pick a color in Figma's color picker, you're using HSB. Our converter lets you copy those values and translate to CSS-compatible HSL or HEX for your code.

CMYK — Print Model

cmyk(16%, 49%, 4%, 4%)  ≈  rgb(59, 130, 246)

Cyan, Magenta, Yellow, Key (Black) — each 0–100%. Subtractive: inks absorb light.

Web vs print gap: RGB screens can display more saturated colors than CMYK printing produces. Bright blues, greens, and neons on screen often appear dull when printed. Use CMYK-verified color profiles for print work.

CSS doesn't support CMYK — convert to HEX/RGB for web use.

Converting for Different Contexts

Target Format to use
CSS custom properties HEX or HSL
JavaScript computation RGB
Design system scales HSL (adjust lightness/saturation)
Figma color picker HSB
Print design CMYK
Modern CSS with P3 oklch

After converting, verify color pairs meet accessibility standards with our Contrast Checker. Use our CSS Formatter to organize custom property declarations after building your palette, and our Gradient Generator to build smooth transitions between your converted colors.

Different color models exist for different workflows — RGB for light, CMYK for print, HSL for human intuition. Understanding which to use and when makes color work faster and more accurate.

Frequently Asked Questions

Everything you need to know about the Color Converter and how your data is handled.

How do I convert a HEX color code to RGB?
Paste your HEX code (e.g., #3B82F6) into the HEX field and the converter instantly shows the RGB equivalent (e.g., rgb(59, 130, 246)) alongside HSL and CMYK values. All four formats update simultaneously so you can copy whichever one your target tool requires.
What is the difference between HEX, RGB, HSL, and CMYK?
HEX (#RRGGBB) is the standard format for CSS and HTML. RGB (Red, Green, Blue) uses 0–255 values per channel and is common in design tools and CSS functions. HSL (Hue, Saturation, Lightness) is intuitive for adjusting colors programmatically. CMYK (Cyan, Magenta, Yellow, Black) is used for print production where colors are mixed from ink, not light.
Why does a CMYK color look different on screen than in print?
Screens use additive RGB color (mixing light), while printing uses subtractive CMYK color (mixing ink). The RGB and CMYK gamuts do not fully overlap — some vibrant screen colors cannot be reproduced in print, and vice versa. The conversion shown is a mathematical approximation; always request a physical proof from your print vendor for color-critical work.
Can I convert multiple colors at once?
The tool converts one color at a time with a live preview. For batch color conversion across a design system or brand palette, the most efficient workflow is to run each brand color through the converter and document the results in your style guide. All calculations run locally with no upload or account required.

Common Use Cases

  • UI Brand Guideline Drafting
  • Frontend Development
  • Print Design Planning

Related Tools