util·tools

Color Converter

Switch a colour between the three formats web pages use to write colour codes — HEX, RGB and HSL — instantly. Pick one visually, preview a live swatch and copy any format with one click. Free, instant and private.

📖 New guide: HEX vs RGB vs HSL Color Codes →

Related tools

About this color converter

Designers and developers constantly translate colours between formats: a hex code from a brand guide, RGB values for a canvas, or HSL to fine-tune a tint. This converter keeps all three in sync — edit any field and the others update instantly, with a live swatch and a native colour picker. Copy whichever format your CSS or design tool needs. It runs entirely in your browser.

Frequently asked questions

How do I convert HEX to RGB?
Type a hex code like #4f8cff in the HEX field — RGB and HSL update instantly.
What is the difference between RGB and HSL?
RGB uses red/green/blue channels; HSL uses hue, saturation and lightness — easier for tints and shades.
Does it support 3-digit hex?
Yes — short codes like #f00 are expanded to #ff0000 automatically.

Understanding Color Notation Systems

Digital color models function by defining how light is displayed on screens using additive color mixing. HEX codes represent colors as hexadecimal triplets, where each pair of characters corresponds to the intensity of red, green, and blue on a scale from 00 to FF. RGB functions similarly but uses decimal integers ranging from 0 to 255 for each channel, providing a more direct view of the underlying hardware instructions. These formats are essentially different shorthand methods for communicating the same quantitative data to a browser or design application.

The HSL model differs by organizing color based on human perception rather than hardware output. Hue is measured in degrees around a color wheel from 0 to 360, while saturation and lightness are expressed as percentages from 0 to 100. Converting from RGB to HSL involves finding the maximum and minimum values of the red, green, and blue channels to determine the lightness, then calculating the saturation based on the difference between those extremes. Hue is derived by determining which channel is dominant and calculating its relative position within the primary color sectors.

A common mistake occurs when users confuse the scale of these values or misinterpret the alpha channel. For instance, attempting to input a decimal value beyond 255 in an RGB field or exceeding 360 degrees for hue will result in invalid color data that browsers cannot render. Developers also frequently forget that HEX shorthand, such as three-digit codes, relies on duplicating each digit to reach the standard six-character length. Understanding these specific boundaries ensures that colors remain consistent across different design environments and CSS implementations.