Hex to RGB Converter
Convert hex color codes to RGB values instantly with our free online converter. Enter any hex color (like #FF5733) and see the RGB equivalent, color preview, and CSS code. Perfect for web designers and developers.
Hex to RGB Converter
Red
59
Green
130
Blue
246
RGB Values
59, 130, 246
CSS Output
rgb(59, 130, 246)
How to Use This Hex To Rgb
- 1Enter a hex color code in the input field (with or without the # symbol).
- 2The converter instantly displays the RGB values for that color.
- 3View the live color preview to confirm it is the correct shade.
- 4Copy the RGB values or CSS code to use in your project.
What Is a Hex To Rgb?
Hexadecimal (hex) and RGB are two different ways to represent colors in digital design. Hex colors use a six-digit code prefixed with #, where each pair of digits represents the intensity of red, green, and blue respectively. RGB colors use three decimal numbers from 0 to 255 to represent the same red, green, and blue intensities. For example, the hex color #FF5733 converts to RGB(255, 87, 51). Both formats produce the exact same color — they are simply different notations. Web designers and developers frequently need to convert between these formats depending on the requirements of their CSS, design software, or programming environment.
Hex To Rgb Formula
To convert hex to RGB, split the hex code into three pairs of digits. Convert each pair from hexadecimal to decimal. The formula for each channel is: decimal = (first_hex_digit × 16) + second_hex_digit. For example, FF in hex = (15 × 16) + 15 = 255 in decimal. Repeat for all three color channels (red, green, blue).
For hex #FF5733: Red = FF = 255, Green = 57 = 87, Blue = 33 = 51. Therefore, #FF5733 = RGB(255, 87, 51).
Tips for Using This Hex To Rgb
Always include the # symbol when writing hex colors in HTML and CSS. When a hex code has repeating pairs (like #FF0000 or #112233), you can use shorthand notation (#F00 or #123). Our converter handles both full 6-digit codes and 3-digit shorthand. For semi-transparent colors, convert to RGBA by adding an alpha channel (0 to 1). If you need the CMYK equivalent for print design, use a dedicated hex-to-CMYK converter as the conversion involves color space mathematics.
Common Values
| Hex Code | RGB Value | Color Name |
|---|---|---|
| #FF0000 | rgb(255, 0, 0) | Red |
| #00FF00 | rgb(0, 255, 0) | Green |
| #0000FF | rgb(0, 0, 255) | Blue |
| #FFFF00 | rgb(255, 255, 0) | Yellow |
| #FF00FF | rgb(255, 0, 255) | Magenta |
| #00FFFF | rgb(0, 255, 255) | Cyan |
| #000000 | rgb(0, 0, 0) | Black |
| #FFFFFF | rgb(255, 255, 255) | White |
| #808080 | rgb(128, 128, 128) | Gray |
| #FFA500 | rgb(255, 165, 0) | Orange |
| #800080 | rgb(128, 0, 128) | Purple |
| #FFC0CB | rgb(255, 192, 203) | Pink |
| #A52A2A | rgb(165, 42, 42) | Brown |
| #FFD700 | rgb(255, 215, 0) | Gold |
| #C0C0C0 | rgb(192, 192, 192) | Silver |
About This Tool
Color representation is one of the foundational concepts in digital design. Every pixel on every screen is defined by numeric color values, and different industries and technologies prefer different formats. Web developers traditionally use hex colors in CSS, while graphic designers and video editors often work with RGB values in software like Photoshop and Premiere. The ability to quickly convert between these formats saves time and prevents errors when collaborating across disciplines. Our hex to RGB converter handles any valid hex code instantly, showing both the numeric values and a live preview so you can verify the color is exactly what you intended.