UtilsDaily

Color Converter

Convert colors between HEX, RGB, HSL, and CMYK formats with live preview.

HEX
RGB
HSL
CMYK

What Is a Color Converter?

A color converter translates a color from one format to another β€” such as from HEX to RGB, or RGB to HSL. Different tools and contexts use different color formats: web CSS uses HEX and RGB, design tools often use HSL for its intuitive controls, and print workflows use CMYK. This converter lets you move between all four formats instantly with a live preview.

How to Use This Color Converter

Edit any field in any format β€” HEX, RGB sliders, HSL sliders, or CMYK sliders β€” and all other formats update automatically. The large color swatch shows a live preview. Use the native color picker to choose a color visually. Click Copy on any format card to copy that format's value to your clipboard.

Color Format Formulas

HEX ↔ RGB

HEX to RGB: Split #rrggbb into pairs and convert each from base-16 to decimal.

RGB to HEX: Convert each decimal (0–255) to a two-character hex string with toString(16).padStart(2,'0').

Example: #3b82f6 β†’ R = 0x3b = 59, G = 0x82 = 130, B = 0xf6 = 246 β†’ rgb(59, 130, 246)

RGB ↔ HSL

Normalise RGB values to 0–1 range. Find max and min channel values. Compute Lightness = (max+min)/2. Saturation = (maxβˆ’min)/(1βˆ’|2Lβˆ’1|). Hue depends on which channel is max.

RGB ↔ CMYK

RGB to CMYK: K = 1 βˆ’ max(R,G,B)/255. C = (1 βˆ’ R/255 βˆ’ K) / (1 βˆ’ K). M = (1 βˆ’ G/255 βˆ’ K) / (1 βˆ’ K). Y = (1 βˆ’ B/255 βˆ’ K) / (1 βˆ’ K).

CMYK to RGB: R = 255 Γ— (1βˆ’C) Γ— (1βˆ’K). G = 255 Γ— (1βˆ’M) Γ— (1βˆ’K). B = 255 Γ— (1βˆ’Y) Γ— (1βˆ’K).

Frequently Asked Questions

What is the difference between RGB and HEX?

Both represent the same colors β€” RGB uses decimal numbers (e.g. rgb(255, 128, 0)) and HEX uses hexadecimal (e.g. #ff8000). Each pair of hex digits maps to one RGB channel. They are interchangeable β€” choose the format your tool expects.

What is HSL?

Hue (0–360Β°), Saturation (0–100%), Lightness (0–100%). More intuitive for design: to make a color darker, decrease Lightness; to desaturate it, decrease Saturation β€” without touching Hue. HSL is supported in all modern CSS browsers.

What is CMYK and when is it used?

Cyan, Magenta, Yellow, Key (Black). Used in color printing β€” subtractive color model where inks on white paper absorb light. Designers specify CMYK for print materials. Note: some bright RGB/screen colors are outside the CMYK gamut and cannot be reproduced exactly in print.

How do I convert HEX to RGB manually?

Split the 6-digit hex into pairs: #1a2b3c β†’ 1a, 2b, 3c. Convert each: 0x1a = 26, 0x2b = 43, 0x3c = 60 β†’ rgb(26, 43, 60). This converter does it automatically.

Why do CMYK colors look different on screen vs. print?

Screens emit light (additive RGB) and can display vivid colors outside the printable CMYK range. When converted, out-of-gamut colors are mapped to the nearest printable color, which may appear less vivid. Always soft-proof in your design application before printing.

Embed This Tool on Your Website

β–Ό