How color converter works
Colors on screens are described in several formats. Hex (hexadecimal) codes like #ff8000 pack red, green, and blue values into a compact string. RGB lists the same three values as decimal numbers (0 to 255). HSL describes color by hue (a circle of 360 degrees), saturation, and lightness.
This converter accepts either a hex color (with or without #, 3 or 6 digits) or an RGB triplet (comma-separated). It immediately shows the color in all three formats: hex, RGB, and HSL. The conversion uses the standard sRGB formulas. Hex and RGB are direct mappings, while HSL is derived from the RGB values.
HSL hue is calculated by finding which of red, green, or blue is largest, then measuring the angular position on the color wheel. Saturation and lightness describe how vivid and how bright the color is. Pure red (#ff0000) is hue 0 degrees, 100 percent saturation, 50 percent lightness.
Frequently asked questions
How do I convert hex to RGB?
Split the hex code into pairs: the first two digits are red, the next two green, and the last two blue. Convert each pair from hexadecimal to decimal. For example, #ff8000 becomes RGB 255, 128, 0. The converter does this automatically.
What is HSL?
HSL stands for Hue, Saturation, and Lightness. Hue is an angle from 0 to 360 degrees on the color wheel. Saturation (0 to 100 percent) is how intense the color is. Lightness (0 to 100 percent) is how light or dark it is. It is often easier for designers to adjust than RGB.
Can I convert RGB to hex?
Yes. Enter the RGB values as comma-separated numbers like 255, 128, 0 and the converter shows the hex code. Each RGB value (0 to 255) is converted to a two-digit hexadecimal number.
What is the difference between hex and RGB?
They represent the same thing in different bases. Hex uses base-16 (digits 0-9 and a-f); RGB uses base-10 (0 to 255). #ff8000 and RGB(255, 128, 0) are the same color. Use whichever your tool or code requires.