Color Converter
Convert any color between HEX, RGB, and HSL in one place. Use the color picker or paste a HEX code, and instantly see all three formats plus a live preview swatch — each copyable with a click. Perfect for web design, CSS, and matching brand colors.
HEX
#0284c7
RGB
rgb(2, 132, 199)
HSL
hsl(200, 98%, 39%)
How to Use
Pick a color with the swatch picker, or type a HEX code (like #0284c7 or the shorthand #08c) into the field. The tool shows the equivalent HEX, RGB, and HSL values and a large preview of the color. Click Copy next to any value to grab it for your CSS or design tool.
Why This Tool Is Useful
Designers and developers constantly move between color formats: HEX for CSS and design files, RGB for transparency and canvas work, and HSL for tweaking hue, saturation, and lightness. Converting by hand is fiddly and error-prone. This tool does it instantly and lets you copy whichever format you need, all in the browser.
HEX, RGB, and HSL Explained
HEX is a six-digit hexadecimal code (like #0284c7) representing red, green, and blue — the most common format in CSS and design tools. RGB expresses the same color as three 0–255 values, which is handy when you need an alpha channel (rgba). HSL describes a color by hue (0–360°), saturation (%), and lightness (%), which makes it intuitive to adjust — for example, to make a color lighter or more muted.
All three describe the exact same colors; they're just different notations.
When to Use Each Format
Use HEX for quick, compact CSS and sharing colors. Use RGB (or RGBA) when you need transparency or are working with canvas/image pixels. Use HSL when you want to tweak a color by hand — nudging lightness or saturation is far easier in HSL than in HEX.
How the Conversion Works
HEX and RGB are direct translations: each pair of hex digits is one 0–255 channel. HSL is derived from RGB with a standard formula that finds the dominant hue and the spread between the lightest and darkest channels. This tool handles both the 6-digit and 3-digit shorthand HEX formats.
Common Colors in HEX and RGB
| Color | HEX | RGB |
|---|---|---|
| Black | #000000 | rgb(0, 0, 0) |
| White | #ffffff | rgb(255, 255, 255) |
| Red | #ff0000 | rgb(255, 0, 0) |
| Green | #00ff00 | rgb(0, 255, 0) |
| Blue | #0000ff | rgb(0, 0, 255) |
| Sky blue | #0284c7 | rgb(2, 132, 199) |