How HEX color codes map to RGB
Screens build every color from red, green and blue light, each with a level from 0 to 255. A HEX color code writes those three levels in base 16, two digits each. In #3B82F6, the first pair 3B is red, 82 is green and F6 is blue. Converting each pair to decimal gives 3 × 16 + 11 = 59, 8 × 16 + 2 = 130 and 15 × 16 + 6 = 246, so the color is rgb(59, 130, 246). Going the other way, you divide each RGB value by 16 to get the two hex digits. HEX codes are not case-sensitive, so #3b82f6 and #3B82F6 are the same color.
Short HEX, 8-digit HEX and transparency
A 3-digit code such as #F80 is shorthand where each digit is doubled, so it means #FF8800. A short code is only possible when both digits of every pair match, which is why the Short HEX row sometimes says it is not available. Modern browsers also accept 4-digit and 8-digit codes, where the last digit or pair is the alpha channel, the opacity. In #3B82F680, 80 in hex is 128 out of 255, about 50% opacity.
The same transparency is written as the fourth value of rgba(), as a decimal from 0 to 1. This converter reads alpha from 8-digit HEX, rgba() and hsla() input, and the opacity slider lets you set it directly. The checkerboard behind the swatch shows how see-through the color is.
RGB versus HSL
HSL describes the same colors in a way that is easier for people to adjust. Hue is the position on the color wheel from 0 to 360 degrees, where 0 is red, 120 is green and 240 is blue. Saturation is how vivid the color is, from gray at 0% to full color at 100%. Lightness runs from black at 0% through the pure color at 50% to white at 100%. To make a lighter version of a brand color for a hover state, you can keep the hue and saturation and raise the lightness. HSL values here are rounded to whole numbers, which is how they are usually written in CSS, so converting back can shift a channel by one step.
Using the values in CSS
All of these formats work in CSS: color: #3B82F6;, background: rgb(59, 130, 246); or border-color: hsl(217, 91%, 60%);. Use rgba() or 8-digit HEX for overlays and shadows. The converter also accepts the newer space-separated syntax, such as rgb(59 130 246 / 50%), and percentage channels. For other front-end conversions, try the PX to REM converter, tidy design tokens with the JSON formatter, or embed a small image as a data URL with the Base64 encoder.