Convert Red, Green, and Blue values into clean 6-digit (#RRGGBB) and 8-digit (#RRGGBBAA) HEX codes. Features interactive R, G, B, and Alpha sliders with live color canvas previews and CSS snippets.
To convert RGB to HEX, convert each integer (0-255) into a 2-digit base-16 hexadecimal number. For example, rgb(99, 102, 241) becomes #6366f1.
Converts each channel number using `num.toString(16).padStart(2,
Each RGB color channel is allocated 1 byte (8 bits) of data in standard 24-bit TrueColor, allowing $2^8 = 256$ distinct brightness levels per channel.