Color converter

Convert color between different formats

Hex, RGB, HSL, HWB, LCH, CMYK, and CSS color names — all in your browser

Last updated: January 25, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Color converter

Edit any row to convert to the others instantly

#1ea54c

Introduction / overview

The Color Converter helps you translate the same color between the formats you actually encounter in real life: design mockups (Hex), CSS (RGB/HSL/HWB), printing (CMYK), and more perceptual spaces like LCH. Everything runs locally in your browser, so it’s fast and private.

A simple rule of thumb: if a tool asks for web colors, Hex/RGB is usually right. If it asks for how a color feels (lighter/darker, more saturated), HSL/LCH is often easier.

Who is this for?

  • Designers moving colors between Figma/Sketch and CSS.
  • Developers normalizing user input (Hex, named colors, RGB strings).
  • Print teams doing quick approximations in CMYK.
  • Anyone trying to keep brand colors consistent across tools.

Reliability note: conversions follow standard color-space math (sRGB as a baseline). If you’re dealing with raw number bases a lot, our Integer Base Converter is also handy for understanding how hexadecimal values work.

How to use / quick start

  1. 1Paste a color into any field (Hex, RGB, HSL, HWB, LCH, CMYK, or a CSS color name). You can also use the color picker for a visual start.
  2. 2As soon as the input is valid, the other formats update instantly. If a field shows an “invalid format” message, tweak the punctuation (commas, parentheses, percent signs) and try again.
  3. 3Use the copy buttons to move values into your CSS, design tool, or print spec. For sharing, generate a link that includes the color.

Worked example 1: Hex → RGB (quick mental check)

Suppose you have #1EA54C\#1EA54C. In Hex, each pair is one channel:RRRR, GGGG, BBBB. So we decode 1E1E, A5A5, 4C4C into decimal.

1E161E_{16}==116+141\cdot 16 + 14==3030
A516A5_{16}==1016+510\cdot 16 + 5==165165
4C164C_{16}==416+124\cdot 16 + 12==7676

Result: RGB(30, 165, 76)\mathrm{RGB}(30,\ 165,\ 76). That “looks right” for a medium-bright green — quick sanity checks like this help you catch typos.

Worked example 2: RGB → Hex (the reverse)

Convert RGB(255, 0, 64)\mathrm{RGB}(255,\ 0,\ 64) to Hex. We convert each channel to base 1616 and pad to 2 digits.

255=1516+15255 = 15\cdot 16 + 15\RightarrowFF16FF_{16},,000160\Rightarrow 00_{16},,64=416+0401664 = 4\cdot 16 + 0\Rightarrow 40_{16}

Result: #FF0040\#FF0040. If you want to double-check any step, the Integer Base Converter is perfect for quick base conversions.

Real-world examples / use cases

From design token to CSS

Background: you receive a brand color as Hex, but your CSS codebase uses HSL for easier theming.

Input: #1EA54C\#1EA54C

Output example: HSL()\mathrm{HSL}(\dots) (copy directly from the tool)

How you use it: paste the HSL string into CSS variables so you can adjust lightness for hover/focus states.

Normalize messy user input

Background: a user pastes rgb(30,165,76)\mathrm{rgb}(30,165,76) in one place and a name likeforestgreen\text{forestgreen} somewhere else.

Inputs: rgb(30,165,76)\mathrm{rgb}(30,165,76) and forestgreen\text{forestgreen}

Output: a single canonical #RRGGBB\#RRGGBB value (copy from Hex row)

How you use it: store the canonical Hex in your database, and convert on display.

Make a lighter/darker variant

Background: you have a base color and need a hover state that’s “the same, just a bit lighter”.

Input: any starting format (e.g. #1EA54C\#1EA54C)

Output: use HSL and adjust LL (lightness) while keeping hue similar.

How you use it: copy the new HSL/RGB into your UI tokens.

Quick CMYK estimate for print

Background: you have a web color but need a rough CMYK value for a print spec sheet.

Input: #FF0040\#FF0040

Output: CMYK()\mathrm{CMYK}(\dots) (use as a starting point)

How you use it: send the CMYK values to a printer, then do a proof print if accuracy matters.

Small but useful workflow

If you’re debugging a UI bug, take the “canonical Hex” and put it into the share link. It gives teammates one exact input to reproduce.

Common scenarios / when to use

You’re copying a color from CSS docs

Great for turning hsl()\mathrm{hsl}(\cdot) into Hex for a design handoff.

You want one “source of truth” value

Store a canonical #RRGGBB\#RRGGBB and convert for display.

You’re tweaking lightness/saturation

HSL and LCH are often more intuitive for “make it a bit darker” adjustments.

You’re preparing something for print

Use CMYK as a starting point, then validate with proofs.

You’re reviewing a pull request

Convert all proposed colors to one format (usually Hex) so diffs are easy to compare.

You’re matching a color across apps

The same color may be presented as Hex in one app and RGB in another.

When it may not be a fit: if you need color management for specific monitors, camera profiles, or print ICC workflows. In those cases, professional color-managed tools are the right next step.

Tips & best practices

  • Prefer Hex or RGB for exact web colors. They map directly to sRGB channelsR,G,B[0,255]R,G,B\in[0,255].
  • Use HSL/LCH when you’re adjusting “feel” (lighter/darker, more/less vivid). It reduces guesswork.
  • If you see unexpected results, check for alpha/opacity. Many color strings can optionally includeα[0,1]\alpha\in[0,1].
  • For copy/paste, keep formatting consistent: CSS usually expects functions likergb()\mathrm{rgb}(\cdot) or hsl()\mathrm{hsl}(\cdot), while design tools often want Hex.
  • If you’re doing many Hex math operations, pair this with the Integer Base Converter for fast base-1616 checks.

Calculation method / formula explanation

Not every color format is “more correct” — they’re just different ways to represent a color. Here are the most common building blocks used in conversions.

1) Hex ↔ RGB

Hex stores each channel as a two-digit base-1616 number:

#RRGGBB\#RRGGBB

Each pair converts by standard base expansion, e.g.A516=1016+5=165\mathrm{A5}_{16} = 10\cdot 16 + 5 = 165.

2) Normalizing RGB

Many conversions start by mapping integer channels to unit values:

r=R255,g=G255,b=B255r = \frac{R}{255},\quad g = \frac{G}{255},\quad b = \frac{B}{255}

After you compute in the normalized space, you convert back to integers when needed.

3) A common CMYK approximation (from normalized RGB)

CMYK varies by printing pipeline, but a widely used approximation from normalized RGB is:

K=1max(r,g,b)K = 1 - \max(r,g,b),,C=1rK1KC = \frac{1-r-K}{1-K},,M=1gK1KM = \frac{1-g-K}{1-K},,Y=1bK1KY = \frac{1-b-K}{1-K}

Important: this is useful for a first pass, but it doesn’t replace proofing or ICC-managed workflows.

Practical takeaway: treat Hex/RGB/HSL as “screen-friendly” values; treat CMYK as “print-friendly starting points”.

Related concepts / background

Hex, RGB, HSL — what’s the difference?

  • Hex is just RGB written in base 1616.
  • RGB is great for “exact bytes”: (R,G,B)(R,G,B).
  • HSL is great for “human edits”: hue HH, saturation SS, lightness LL.

Why do conversions sometimes “look” different?

Two common reasons:

  • Different color spaces and assumptions (especially around gamma and perceptual spaces).
  • Rounding. Many formats display fewer decimals, so tiny rounding differences are normal.

Frequently asked questions (FAQs)

Why does the tool change my Hex case or format?

Many tools normalize output (for example, using uppercase). The actual color stays the same.

What Hex format does this tool use?

It uses the common 6-digit format #RRGGBB\#RRGGBB.

Can I paste a CSS color name like “red”?

Yes. If a name maps to a known CSS color, the converter can normalize it to Hex/RGB. When a name isn’t recognized, the tool will tell you the format is invalid.

Why does my CMYK result look “off” compared to print proofs?

CMYK depends heavily on printer, paper, and ICC profiles. Browser-based conversions are best treated as starting points.

What does “LCH” mean, and when should I use it?

LCH is a perceptual color space that often matches how people describe color differences. It can be nicer for building smooth gradients or consistent lightness steps.

Is there a quick way to verify a Hex ↔ RGB conversion?

Yes: use the base expansion check in the examples above, or jump to the Integer Base Converter to verify each channel.

Does the converter run on the server?

No — conversions run locally in your browser.

Limitations / disclaimers

  • CMYK conversions are approximations and may differ from your printer’s color-managed pipeline.
  • Screen appearance depends on display calibration and lighting; “the same numbers” can look different across devices.
  • This tool is for conversion and sanity checks; it does not replace professional color management or print proofing.

External references / sources

Note: references are provided for further reading; the tool’s outputs are designed for practical conversions, not for replacing a color-managed workflow.

Color Converter - Hex, RGB, HSL, HWB, LCH, CMYK, Name