🎨 Color Converter

Pick a color or type a HEX code — HEX, RGB and HSL convert instantly with a live preview.

HEX
-
RGB
-
HSL
-

How to use the color converter

Click the picker to choose a color visually, or type a HEX code like #2563EB (with or without the #). All three notations update together, and the preview strip shows exactly what the color looks like. Copy whichever format your CSS, design tool, or style guide expects.

Three notations, one color

The same color can be written three ways, and each format has a home turf:

FormatWritten asWhere it shines
HEX#2563EBCSS and design tools; compact and copy-paste friendly
RGBrgb(37, 99, 235)Channels 0–255; use rgba() when you need opacity
HSLhsl(221, 83%, 53%)Building palettes — nudge hue, saturation or lightness independently
8-digit HEX#2563EB80The last pair is alpha (00 = transparent, FF = opaque)
Short HEX#25EValid only when each pair repeats (#AABBCC → #ABC)

How the conversion works

HEX is just RGB written in base 16: split #RRGGBB into three pairs and parse each as a hexadecimal number. RGB → HSL normalizes the channels to 0–1, takes the max and min, and derives hue from which channel dominates, saturation from the spread between max and min, and lightness from their average. The math is a fixed formula, so the conversion is exact — what varies between screens is only how the color is rendered.

When you need it

Turning a designer's HEX hand-off into an rgba() value with transparency, generating lighter and darker shades by adjusting HSL lightness, matching a brand color across tools that accept different notations, or checking WCAG contrast by feeding two colors' RGB values into the contrast formula.

Assumptions and limitations

This is a screen-color (RGB) tool. Print workflows use CMYK or Lab color spaces, and no exact RGB↔CMYK conversion exists without a color profile — important print jobs always need a proof. Short HEX only compresses when both digits in each pair match. Identical numbers can render slightly differently across monitors because of color management, which is a property of the display, not of the conversion.

Frequently Asked Questions

HEX or RGB — which should I use in CSS?

They are equivalent and browsers treat them identically, so follow your team's convention. HEX is shorter and matches what design hand-offs usually specify; RGB is the natural choice when you need transparency via rgba(), though 8-digit HEX (#3B82F680) covers that too.

Why does my color print differently from the screen?

Monitors mix light (RGB, additive); printers mix ink (CMYK, subtractive). The two gamuts don't overlap fully — vivid screen blues and greens often come out duller on paper. For anything critical, ask the print shop for a proof before the full run.

What does the H in HSL actually mean?

Hue is the position on the color wheel in degrees: 0° red, 120° green, 240° blue, wrapping back to red at 360°. Because hue is independent of saturation and lightness, HSL makes it easy to build a palette — keep the hue, raise or lower lightness for shades, and the color stays recognizably "the same".

What contrast ratio do I need for accessibility?

WCAG requires at least 4.5:1 between text and its background for body text, and 3:1 for large text (18pt+ or 14pt bold). Convert both colors to RGB here, then compute luminance for each and apply the contrast formula — a one-minute check that can save a redesign.

🛒 Recommended for You

As an Amazon Associate, Benditools earns from qualifying purchases.