About RGB to HEX
Going from RGB to hex means writing each channel in base 16 and padding it to two digits. 74 becomes 4a, 73 becomes 49, 216 becomes d8, giving #4a49d8. The padding matters: a value under 16 produces a single digit that must be written as 0f rather than f, or the whole code shifts and the colour comes out wrong.
If your colour has an alpha below 1, the modern eight-digit hex form encodes it as a fourth pair. Support is universal in current browsers, so rgba(74, 73, 216, 0.5) can be written as #4a49d880 with no compatibility concern.
Hex remains the most portable way to write a colour down. Every design tool, every CSS file and every configuration format accepts it, which is why it is still the default despite being the least human-readable of the formats.
How to convert RGB to HEX
Enter your RGB values
Paste rgb(74 73 216) or rgb(74, 73, 216). Both syntaxes are accepted, with or without an alpha value.
Copy the hex code
The highlighted row gives the hex value. An alpha below 1 produces the eight-digit form automatically.
Adjust if you want to
The hue, saturation and lightness sliders change the colour, and the hex code follows as you drag.