RGB is how screens actually produce color
Every pixel on an LCD, OLED, or LED display is physically made of three tiny sub-pixels — one red, one green, one blue — and the color you see at that pixel is the combined light from those three, each at its own brightness. RGB notation, whether written as rgb(59, 130, 246) or as the hex equivalent #3B82F6, directly specifies the intensity of each of those three sub-pixels on a scale of 0 to 255. That's why RGB (and hex, which is just RGB packed into a more compact string) is the native format for describing color on a screen: it maps almost exactly onto the physical hardware producing the light, unlike HSL, CMYK, or any other color model, all of which are mathematical transformations built on top of this same underlying RGB data.
Converting hex to RGB, digit by digit
A 6-digit hex color splits into three 2-digit byte pairs, one per channel: the first two digits are red, the middle two are green, the last two are blue. Each pair is converted from hex to decimal using ordinary positional arithmetic — #3B82F6 splits into 3B, 82, andF6, which convert to 59, 130, and 246 respectively. There's no cross-channel math involved; each byte pair is entirely independent of the other two, which is what makes this conversion mechanically simple compared to HSL or HSV, both of which require combining all three channels together through trigonometric-style formulas to derive a single hue value.
Why 0–255 specifically
Each RGB channel is stored as one byte, and a byte holds 256 distinct values, 0 through 255 — so 0–255 isn't an arbitrary design choice, it's the direct consequence of allocating exactly 8 bits per color channel. Three channels at 8 bits each add up to 24 bits per pixel, commonly called "24-bit color" or "true color," capable of representing about 16.7 million distinct colors (256 cubed). Some professional imaging and color-grading workflows use higher bit depths per channel (10 or 16 bits) for finer gradients and to avoid visible banding in subtle gradients, but 8-bit-per-channel RGB remains the standard for web content, consumer displays, and most everyday image formats.
3-digit shorthand hex
CSS also permits a 3-digit hex shorthand, where each digit is duplicated to form the full 2-digit byte —#F00 expands to #FF0000, not #F0F000 or any other combination. This shorthand only works when both digits of each byte pair happen to be identical, which is why it's only available for a limited subset of colors (16 possible values per channel instead of 256) — a color like #3B82F6 has no 3-digit equivalent, since none of its channel byte pairs repeat the same digit twice. This tool accepts the shorthand form as valid input and normalizes it to the full 6-digit form internally.
A worked example
Take #3B82F6, a blue commonly used as an accent color in web design. Splitting it into byte pairs: 3B, 82, F6. Converting each with positional arithmetic — 3B is (3 × 16) + 11 = 59; 82 is (8 × 16) + 2 = 130;F6 is (15 × 16) + 6 = 246 — gives red 59, green 130, blue 246, orrgb(59, 130, 246). Because blue's byte pair is the largest of the three (246, close to the maximum of 255) and red is the smallest (59), the resulting color reads as a clear, moderately saturated blue, which matches what the hex code visually renders as.
When to reach for RGB versus another format
RGB and hex are the right choice whenever the destination is code — CSS, a graphics API, an image file format — since that's the format those systems actually store and process natively. HSL is usually easier when a human is adjusting a color by hand (lightening or desaturating a specific hue), and CMYK is relevant only when the output is destined for physical ink on paper. Converting a color to check its values in a different format, without changing which one is used in the final code, is exactly what the other tools in this section are for.