Converters
Calculators
Other Tools
Browse tools
Web tools

Color converter

Convert between HEX, RGB, HSL, and CMYK — edit any field and every other format, plus the swatch preview, updates instantly.

Never leaves your device No signup Free forever Not stored, not logged

Color

RGB

HSL

All formats
HEX
#3B82F6
RGB
rgb(59, 130, 246)
HSL
hsl(217, 91%, 60%)
CMYK
cmyk(76%, 47%, 0%, 4%)
More web tools

Related tools you might need next

All web tools

How it works

Three steps, no account

1

Start from any format

Type a hex code, pick a color, or set RGB or HSL numbers directly — there's no single "correct" starting point.

2

Watch everything sync

Edit one field and HEX, RGB, HSL, CMYK, and the swatch preview all update together, in real time.

3

Copy what you need

Each format has its own copy button, or grab all four values at once with "Copy all".

FAQ

Common questions

Why does CMYK look different from what my printer produces?
This tool uses the standard device-independent CMYK conversion formula from RGB. Real-world printing uses ICC color profiles specific to the printer, ink, and paper, so printed output can shift noticeably from this calculated value — treat it as a close estimate, not a print-ready spec.
Why does HSL round-trip slightly differently than what I typed?
RGB only has 256 discrete steps per channel, while HSL is calculated in floating point and then rounded to whole degrees and percentages for display. Converting HSL to RGB and back can land on a value one unit off from what you entered — a normal side effect of rounding, not a bug.
What's the difference between HEX, RGB, HSL, and CMYK?
HEX and RGB both describe additive light (red, green, blue) — HEX is just RGB written as base-16 pairs. HSL describes the same color by hue, saturation, and lightness, which is often more intuitive for adjusting a color by eye. CMYK is subtractive — it describes how much cyan, magenta, yellow, and black ink to lay down for print.
Is my color data sent anywhere?
No. Every conversion runs entirely in your browser using plain JavaScript math — nothing is transmitted, logged, or stored.
ad slot · bottom of content 336×280 / responsive
Related

People who used this also used

Color Converter

Our Color Converter helps you translate a color between HEX, RGB, HSL, and CMYK instantly. Edit any format — a hex code, individual RGB numbers, or HSL numbers — and every other format, plus a live swatch preview, updates as you type.

How to Use the Color Converter

1. Enter a Color

  • Type a hex code like #3B82F6
  • Or set the R, G, B number fields directly
  • Or set the H, S, L number fields directly
  • Or click the color swatch to open your browser's native picker

2. Watch Everything Update

  • HEX, RGB, HSL, and CMYK stay in sync automatically
  • The swatch preview shows the current color
  • No submit button — every field is live

3. Copy What You Need

  • Copy any single format with its own button
  • Or copy all four values at once

Key Features

Conversion Coverage

  • HEX to RGB and back
  • RGB to HSL and back
  • RGB to CMYK
  • Live two-way sync across all fields

Input Options

  • Direct hex text entry
  • Numeric R/G/B inputs (0–255)
  • Numeric H/S/L inputs (degrees and percentages)
  • Native browser color picker

Use Cases

1. Web & App Design

  • Matching a brand color across CSS, design tools, and print specs
  • Converting a picked color into a CSS-ready hex, rgb(), or hsl() string
  • Checking a color's HSL breakdown to nudge lightness or saturation

2. Front-End Development

  • Pasting a designer-supplied hex code and getting the RGB values a canvas or JS API expects
  • Converting CSS variables between formats when refactoring a stylesheet
  • Quickly previewing what a color looks like before committing it to code

3. Print & Branding

  • Getting an approximate CMYK breakdown for a brand color defined in RGB
  • Comparing how a screen color might translate before sending it to a printer
  • Documenting a full color spec (all four formats) in one copy

Technical Features

  • Live Two-Way Binding: Any field can be the source of truth; the rest follow
  • Standard Color Math: HSL and CMYK use the same formulas used across browsers and design tools
  • Swatch Preview: See the color, not just the numbers
  • Per-Format Copying: Grab exactly the string you need

Why Use Our Color Converter

1. No Guesswork

  • Every format updates from every other format
  • No manual math, no separate lookup tables

2. Accurate Conversion

  • Standard RGB↔HSL trigonometric conversion
  • Standard RGB↔CMYK subtractive-color formula
  • Rounds consistently so displayed values are easy to reuse

3. Privacy Focused

  • Client-side processing only
  • No color values are ever sent to a server
  • Works offline once the page has loaded

Understanding Color Spaces

HEX

A hex color is just RGB written as three base-16 byte pairs — #3B82F6 is red 3B (59), green 82 (130), and blue F6 (246). It's compact and is the most common way to write a color in CSS and design tools.

RGB

RGB (red, green, blue) is an additive color model: each channel ranges from 0 to 255, and mixing all three at full intensity produces white. It maps directly to how screens emit light.

HSL

HSL (hue, saturation, lightness) describes the same colors as RGB but in terms that are easier to reason about by eye — hue is a position on the color wheel (0–360°), saturation is how vivid the color is (0–100%), and lightness is how close it is to black or white (0–100%). It's the format most people reach for when they want to adjust a color rather than pick one from scratch.

CMYK

CMYK (cyan, magenta, yellow, key/black) is a subtractive model used in printing, where ink absorbs light rather than emitting it. Converting from RGB to CMYK is a mathematical approximation — actual printed color also depends on the specific inks, paper, and printer profile in use.

Common Applications

  1. CSS & Design Tokens: Writing colors in whichever format a codebase or design system standardizes on
  2. Brand Guidelines: Documenting a single brand color across screen and print formats
  3. Data Visualization: Adjusting hue and lightness programmatically via HSL
  4. Print Production: Getting an approximate CMYK starting point for a digital color

Remember: HEX and RGB are exact, interchangeable representations of the same value, while HSL is a reformulation for readability and CMYK is an approximation intended for print — treat converted CMYK values as a starting point to confirm with your printer, not a final spec.