Home/Tools/Colors/Color Converter
Colors · Generator

Color Converter

Convert colors between HEX, RGB, HSL, and other formats instantly.

Pick a Color

Preview

Color Formats

HEX

#6366F1

RGB

rgb(99, 102, 241)

RGBA

rgba(99, 102, 241, 1)

HSL

hsl(239, 84%, 67%)

HSLA

hsla(239, 84%, 67%, 1)

HWB

hwb(239 39% 5%)

100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the Color Converter?

Convert colours instantly between HEX, RGB, HSL, HSV, CMYK, and CSS named colours. Paste any value and get all formats at once.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the Color Converter

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Paste or type any colour value

Enter a HEX code, an RGB value, an HSL value, or a CSS colour name. The converter detects the format automatically.

2

See all formats at once

All output formats update instantly: HEX, RGB, RGBA, HSL, HSLA, HSV, and CMYK appear side by side.

3

Copy the format you need

Click the copy icon next to any format to grab that specific string. Use whichever format fits your codebase.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
/* Same colour in every format */
--color-primary-hex:  #6C2EF5;
--color-primary-rgb:  rgb(108, 46, 245);
--color-primary-hsl:  hsl(262, 91%, 57%);
--color-primary-hwb:  hwb(262 18% 4%);

/* Use whichever format fits your context */
.button { background: hsl(262, 91%, 57%); }
.overlay { background: rgba(108, 46, 245, 0.4); }

HSL is easiest to adjust by eye - change the L value to lighten or darken without touching the hue.

Pro tips

Pro tips for better results

Use HSL for design system colours

HSL makes it easy to create tint/shade scales by changing only the L (lightness) value. Keep H and S fixed for a cohesive palette.

RGBA for opacity in CSS variables

CSS custom properties do not support the slash syntax inside rgb(). Use rgba(r, g, b, a) for opacity-capable variables that work across all browsers.

CMYK is for print, not screens

Browsers render everything as RGB. CMYK values from this tool are a reference for print handoff - do not use CMYK directly in CSS.

Named colours have inconsistent rendering

CSS named colours like "red" or "cornflowerblue" render differently in print and some PDF renderers. Always use HEX or RGB in production CSS.

FAQ

Frequently asked questions

HEX (3 and 6 digit), RGB, RGBA, HSL, HSLA, HSV, HWB, CMYK, and CSS named colours. Paste any of these into the input field.
They are the same colour - just different representations of the same point in colour space. Any visual difference is a rendering artefact on your screen, not a conversion error.
rgba() adds an alpha (opacity) channel. rgb(108, 46, 245) is fully opaque. rgba(108, 46, 245, 0.5) is 50% transparent. Modern CSS also accepts rgb(108 46 245 / 0.5) with the space syntax.
No. All conversions run in your browser using JavaScript. Nothing is sent to any server.

From the blog

Read more