How to convert HEX to RGB
A six-digit HEX color contains three pairs: RR, GG and BB. Convert each pair from base 16 to a decimal integer between 0 and 255. For #3366CC, 33 becomes 51, 66 becomes 102 and CC becomes 204, giving rgb(51, 102, 204). Use the result in a CSS declaration or a design application.
RGB to HEX: channel order and limits
For the reverse conversion, enter red, green and blue as whole numbers from 0 to 255. Each number becomes a two-digit hexadecimal pair, including a leading zero where needed. RGB(0, 128, 255) becomes #0080FF. This converter handles opaque six-digit colors; it does not process an alpha transparency channel.