Need to convert a hex color code to RGB or the other way around? Our free online Hex ↔ RGB Color Converter makes it effortless. Simply enter a hex value like #1a73e8 or RGB values like rgb(26, 115, 232) and get your result in one click — with a live color preview so you always know exactly what color you're working with.
A hex color code is a six-character (or three-character shorthand) representation of a color used in web design and CSS. It starts with a # symbol followed by three pairs of hexadecimal digits representing the red, green, and blue (RGB) components of the color. For example, #FF0000 is pure red, #00FF00 is pure green, and #0000FF is pure blue.
RGB stands for Red, Green, Blue. It's a color model where each component is expressed as a number from 0 to 255. The combination of these three values produces any color visible on a screen. For example, rgb(255, 0, 0) is red, rgb(0, 255, 0) is green, and rgb(0, 0, 255) is blue.
Each pair of hex digits in a color code corresponds to one RGB channel. To convert, take each two-character pair, interpret it as a base-16 (hexadecimal) number, and that gives you the decimal value for that channel. Our tool does this automatically — just paste your hex code and click Convert.
To go from RGB to hex, each decimal channel value (0–255) is converted to a two-digit hexadecimal number and the three results are concatenated with a # prefix. Our tool handles the conversion instantly with a live color preview so you can visually confirm the result.