Enter R, G, B values or drag the sliders to convert any RGB color to its HEX code, HSL, and CSS values. Live preview updates instantly. See also: Hex to RGB.
Runs in your browser · No data sent anywhereConvert each channel (0–255) to a two-digit hex number. For rgb(34, 197, 94): Red = 34 → 22, Green = 197 → C5, Blue = 94 → 5E → #22C55E. Use a calculator with hex mode or parseInt/toString(16) in JavaScript.
RGB stands for Red, Green, Blue — the three color channels used by screens. Each channel ranges from 0 to 255. rgb(0,0,0) is black; rgb(255,255,255) is white; rgb(255,0,0) is pure red.
Both work identically in CSS. HEX is more compact in HTML/CSS codebases. RGB is easier to read and adjust programmatically. For transparency, use rgba() or the modern rgb() with slash syntax: rgb(34 197 94 / 50%).
Standard RGB uses 8 bits per channel (0–255, ~16.7 million colors). 16-bit uses 16 bits per channel (0–65535) for far more precision — used in HDR displays and image editing but not standard CSS.