HEX to RGB Converter with HSL & CMYK Values

HEX to RGB Converter with HSL & CMYK Values

Paste a HEX code and copy its RGB, HSL and CMYK values instantly, with 4 harmony colors, a contrast check against white and CSS palette export.

Updated November 2026

Reviewed by Rafael Duarte

Active Preview

#197FE6

Harmony Colors

Format Conversions

WCAG AA: Fail
WCAG AAA: Fail
4.02:1 vs white

Tip: Click a harmony color swatch to use it. Press Shift+Enter to copy the HEX value.

How to convert HEX to RGB

Paste a HEX code, get RGB, HSL and CMYK

1. Paste the HEX code

Type or paste a 6-digit hex code, with or without the # (for example #3A86FF), or pick the color from your browser's color swatch.

2. Copy the format you need

Format Conversions shows HEX, RGB, HSL, and CMYK side by side. Click the copy icon next to any of them.

3. Save to a palette and export

"Save to Palette" keeps the color; "Export Palette" downloads a palette.css file with the colors as CSS custom properties.

What this HEX to RGB converter does

From HEX to RGB, HSL and CMYK, no math by hand

HEX to RGB, HSL and CMYK at once

All three appear next to each other, ready to copy: rgb() with 0–255 channels, hsl() with whole-number degrees and percentages, and CMYK as four numbers from 0 to 100.

Standard formulas

RGB comes straight from the hex pairs; HSL and CMYK use the standard formulas from RGB, rounded to whole numbers.

4 harmony colors

Your color with the hue rotated +90°, +150°, +180°, and +270°. Only +180° is the true complement; +90° and +270° complete a square (tetradic) scheme and +150° is one half of a split complement. Click a swatch to use it.

Contrast vs. white

WCAG AA (4.5:1) and AAA (7:1) badges show whether the color works as text on a white background.

CSS custom properties export

Save several colors and download a palette.css with --palette-1, --palette-2 and so on.

Keyboard shortcut to copy

Press Shift+Enter while no text field has focus to copy the active HEX value without clicking.

Color formats explained

What each notation means and where it's used

Format
Example
HEX
#1A73E8 — the universal shorthand in CSS and design tools
RGB
rgb(26, 115, 232) — red, green, blue channels, 0–255 each
HSL
hsl(214, 82%, 51%) — hue, saturation, lightness
CMYK
89, 50, 0, 9 — cyan, magenta, yellow and key (black) in %, a rough conversion without a color profile
3-digit HEX
#FFF isn't accepted — expand it to the full 6 digits, #FFFFFF

When you'll reach for this tool

The scenarios that come up most often

Design-to-code handoff

Designers hand off colors in HEX; in code you often want rgb() to work with transparency, or hsl() for theme variations and hover states.

Quick contrast check

See whether a brand color passes AA as text on white. To test text on any background, use the Color Contrast Checker.

A first reference for print

Get a rough CMYK for a screen color to start the conversation with your print shop. The final values should come from the color profile the printer uses, not from this formula.

Building a design system

Save every brand color into one palette, then export the whole set as CSS custom properties in a single download. Starting from a photo or logo instead? Pull the colors from an image.

Common mistakes

Assuming on-screen RGB matches printed CMYK exactly

The CMYK here is the simple formula, with no ICC color profile, so it can't tell you whether a color is printable. Some vivid screen blues and greens fall outside the printable gamut; check with your printer before you finalize the file.

Misreading HSL lightness at 50%

50% lightness is the pure hue; values above it lighten toward white, below it darken toward black — it's not the same axis as HSV brightness.

Forgetting the # when pasting hex

Hex codes work here with or without the leading #, but keep the habit — plenty of other tools and CSS itself require it.

Pasting a 3-digit shorthand hex

Codes like #FFF aren't recognized; the field needs all 6 digits. Double each character before pasting, so #FFF becomes #FFFFFF.

Why use this HEX to RGB converter

Paste one HEX code and copy RGB, HSL, and CMYK from the same screen, with no need for a separate converter for each format.

The contrast badge against white saves an extra step: you already know whether a color works as text on white before you leave the page. Need to choose a color from scratch or grab one from your screen? Pick it visually or with the eyedropper first.

Everything runs in your browser, with no signup and nothing sent to a server.

Frequently asked questions

Type or paste a 6-digit hex code, with or without the #, and the RGB value appears right away in the RGB (Red, Green, Blue) field, ready to copy. For example, #FF8000 converts to rgb(255, 128, 0).

Further reading

Related Tools