RGB to Hex
Enter red, green and blue channel values (0–255) to generate the matching Hex code.
Each channel must be a whole number between 0 and 255.
Switch between RGB and Hex color codes instantly, copy either result and view a live preview of the shade.
Enter red, green and blue channel values (0–255) to generate the matching Hex code.
Each channel must be a whole number between 0 and 255.
Paste a 3- or 6-digit Hex color to see the RGB representation.
Use #RRGGBB or #RGB format. Letters are case-insensitive.
RGB expresses colors as light intensity values for red, green and blue. It is the native format for screens, LEDs and most design software.
When you need to tweak contrast, accessibility or gradients, editing individual RGB channels gives precise control.
Hex compresses the three RGB channels into a compact six-character code that is easy to paste into CSS, design tokens and code snippets.
The format travels well between tools and keeps colors readable for designers and developers alike.
Follow these steps to switch between RGB and Hex without a calculator.
To go from Hex to RGB, split the string into pairs, convert each pair from base 16 to base 10 and reuse the resulting decimals.