DevTools Logo

Color Converter

Color Converter

Convert a color between HEX, RGB, HSL, HSV, CMYK, LAB, LCH, OKLab and OKLCH.

Runs in your browser
Try an example

Source color

#3B82F6
rgb0–255
hslHue in degrees, S/L 0–100%

Each field converts back to sRGB; values outside the gamut are reported above the result.

Converted formats

#3B82F6
CMYK is a device-independent approximation; real print output depends on the press, ink and paper profile.

#3B82F6

Closest: royalblue · Δ33

  • HEX#3B82F6
  • RGBrgb(59, 130, 246)
  • HSLhsl(217, 91, 60)
  • HSVhsv(217, 76, 96)
  • CMYKcmyk(76, 47, 0, 4)
  • LABlab(56 18 -64)
  • LCHlch(56 67 285)
  • OKLaboklab(62.31 -0.0332 -0.1851)
  • OKLCHoklch(62.31 0.188 259.81)
  • CSS variable--primary-color: #3B82F6;
  • SCSS variable$primary-color: #3B82F6;

Examples

Convert a single color across every space

Input
#3B82F6
Output
HEX   #3B82F6
RGB   rgb(59, 130, 246)
HSL   hsl(217, 91%, 60%)
HSV   hsv(217, 76%, 96%)
CMYK  cmyk(76%, 47%, 0%, 4%)

The same color in the five formats the converter produces — paste any one to populate the others.

Resolve a CSS named color to HEX

Input
tomato
Output
HEX   #FF6347
RGB   rgb(255, 99, 71)
HSL   hsl(9, 100%, 64%)

140+ CSS named colors map to fixed sRGB values, so a name like "tomato" becomes a copy-pastable hex.

Batch-convert a palette

Input
#3B82F6
#10B981
#F59E0B
#EF4444
Output
IN   HEX    → HSL
#3B82F6  → hsl(217, 91%, 60%)
#10B981  → hsl(160, 84%, 39%)
#F59E0B  → hsl(38, 92%, 50%)
#EF4444  → hsl(0, 84%, 60%)

Drop a whole Tailwind-style palette and get HSL tokens for CSS variables in one go.

Use cases

Moving between design tools

A color you sampled as HEX in a picker needs to live as `hsl()` in your design tokens, or as `rgb()` in a canvas pipeline — keep every representation in sync without manual math.

Building accessible color systems

Convert a base color to HSL so you can tune lightness for AA/AAA contrast, then re-export as HEX to drop into Figma or a CSS file.

Print preparation

Translate a screen RGB or HEX into its CMYK approximation so a designer can sanity-check what a brand color will look like on press.

Generating theme tokens from a brand color

Use HSL output to derive hover/active/dark variants of a primary color by tweaking only the lightness, keeping hue and saturation stable.

Common mistakes

Mistake:Mixing up HSL and HSV.

Fix:They share the same hue wheel but differ on the third axis: HSL's L=50% is the perceptual midpoint; HSV's V=100% is the brightest a color can be. "Make it lighter" usually means HSL.

Mistake:Round-tripping CMYK → RGB → CMYK to "fine-tune" a print color.

Fix:Each conversion drifts slightly out of gamut, so looping through it bakes in error. Convert CMYK to RGB once and edit from the screen representation.

Mistake:Trusting CSS color names to be the same forever.

Fix:Color names were redefined in CSS Color Level 4 (e.g. `rebeccapurple`) — old references can list a different HEX than the current spec.

Mistake:Assuming a color-blindness simulation equals a real check.

Fix:The simulation shows how a viewer may perceive your palette, but WCAG contrast ratios are the actual accessibility gate — check the contrast ratio against your background, not just the simulation.

Frequently asked questions

What color formats does it convert between?

HEX, RGB, HSL, HSV and CMYK — paste any one representation and the others update instantly. The converter also recognises 140+ CSS named colors.

What's the difference between HSL and HSV?

They share the same hue wheel but differ on the third axis. HSL's L=50% is the perceptual midpoint of a color, while HSV's V=100% is the brightest it can be. For 'make it lighter' or 'make it darker', HSL is usually the right choice.

Why convert to CMYK?

CMYK is a print gamut approximation — useful for sanity-checking what a screen color will look like on press. RGB and HEX are the formats you actually ship for digital work.

Is my color data sent to a server?

No. Conversion is pure math done locally in your browser, so nothing you paste leaves your device.

References & standards