Log in Sign Up

Color Converter

Convert between HEX, RGB, and HSL, and pull a palette from any image.

Palette from image

About This Tool

The Color Converter translates a color between HEX, RGB, and HSL and shows a live preview. Type any one format or use the picker, and the others update automatically. You can also upload an image to extract its dominant colors as a palette, with each swatch showing its HEX value for quick copying.

Conversion and palette extraction run in your browser, so images are never uploaded.

  • check_circleConvert between HEX, RGB, and HSL
  • check_circleLive color preview and color picker
  • check_circleExtract a dominant-color palette from any image
  • check_circleRuns in your browser, nothing uploaded

HEX, RGB, and HSL describe the same colour differently

All three notations address the same sRGB colour space; they differ in what is easy to change. HEX is a compact way of writing three 0-255 channel values in base 16, so #FF6B35 is simply red 255, green 107, blue 53. RGB writes those numbers in decimal, which is easier to read and lets you attach an alpha channel with rgba(). Neither tells you anything useful about the colour by looking at it.

HSL is the one built for humans. It splits colour into hue (0-360 degrees around a colour wheel), saturation (0-100 percent, grey to vivid), and lightness (0-100 percent, black to white). That separation is why HSL is the right notation for building a palette: keep the hue fixed and vary lightness to generate a consistent tint and shade ramp for a design system, or rotate the hue by 180 degrees for a complementary accent. Doing the same in HEX means guessing.

Contrast and accessibility, the part that gets skipped

A colour pair that looks fine to a designer on a bright monitor can be unreadable to a user with low vision or on a phone in sunlight. WCAG 2.1 sets measurable minimums: body text needs a contrast ratio of at least 4.5:1 against its background, and large text (18pt, or 14pt bold) needs 3:1. Interface components and meaningful graphics also need 3:1. The AAA level raises body text to 7:1.

Contrast is calculated from relative luminance, not from how different two hues look, which produces some counter-intuitive results. Mid-grey text on white fails easily. Two strongly different hues at the same lightness, such as a saturated red on a saturated green, can have almost no contrast at all while looking loud, and are exactly the pairing that disappears for the roughly 8 percent of men with red-green colour vision deficiency. Never carry meaning in hue alone; pair it with a label, an icon, or a pattern.

Where colour codes go in a real project

Keep colours in one place. Define each brand colour once as a CSS custom property on :root and reference the variable everywhere else. When a colour changes, you edit one line rather than hunting hex codes through a stylesheet, and a dark theme becomes a matter of redefining the same variable names inside a media query.

Some format-specific notes. HEX with an alpha channel is written as eight digits (#FF6B3580) and is supported in every current browser, though older tooling may not parse it. CSS named colours such as tomato and rebeccapurple are exact sRGB values, not approximations, and are fine to use. Print work needs CMYK, which has a smaller gamut than sRGB, so vivid screen colours will shift when converted and should be checked against a proof rather than trusted from a converter. Newer CSS colour spaces like oklch() give more perceptually even lightness ramps than HSL and are worth adopting for palette generation.

Choosing a colour notation

FormatExampleBest for
HEX#FF6B35Compact values in design handoffs and CSS
RGB / RGBArgb(255 107 53 / 80%)Programmatic colour, transparency
HSL / HSLAhsl(16 100% 60%)Building tint and shade ramps, theming
CMYK0, 58, 79, 0Print output, requires a proof to trust
OKLCHoklch(70% 0.19 40)Perceptually even palettes in modern CSS

Frequently Asked Questions

Which color formats are supported? expand_more

HEX (for example #ff6b35), RGB (rgb(255, 107, 53)), and HSL (hsl(16, 100%, 60%)) are all supported and stay in sync.

How is the image palette created? expand_more

The image is drawn to a canvas in your browser and the most frequent colors are grouped into a small palette of representative swatches.

Is my image uploaded? expand_more

No. The image is read locally in your browser and is never sent to a server.