ToolNimbus

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

ColorHEXRGB
Black#000000rgb(0, 0, 0)
White#ffffffrgb(255, 255, 255)
Red#ff0000rgb(255, 0, 0)
Green#00ff00rgb(0, 255, 0)
Blue#0000ffrgb(0, 0, 255)
Sky blue#0284c7rgb(2, 132, 199)

Frequently Asked Questions

How do I convert HEX to RGB?

Split the six-digit HEX into three pairs and convert each from hexadecimal to a 0–255 number. This tool does it instantly — just paste your HEX code.

How do I convert RGB to HEX?

Convert each 0–255 channel to a two-digit hexadecimal value and join them with a # prefix. Enter a color above to see its HEX.

What is HSL and when should I use it?

HSL is hue, saturation, and lightness. It's the easiest format for adjusting a color by hand — for example, making it lighter or less saturated.

Does it support 3-digit HEX shorthand?

Yes. Shorthand like #08c is expanded to #0088cc automatically before converting.

Are these conversions exact?

HEX and RGB are exact. HSL values are rounded to whole numbers for readability, which is standard for CSS.

Related Tools