Hex to RGB Converter
Last updated:
How to Use This Calculator
Step 1: Select Hex to RGB or RGB to Hex.
Step 2: Enter hex code (#FF5733) or RGB values (0-255 each).
Step 3: Click Calculate for the converted code plus CSS format.
Hex and RGB Colors
Screens mix Red, Green, Blue at intensities 0-255. Hex codes represent RGB compactly: #RRGGBB. #FF5733 = Red:255, Green:87, Blue:51.
Both work in CSS. Hex is shorter (#FF5733), RGB is more readable (rgb(255,87,51)).
Conversion Formula
Hex to RGB: Split into 3 pairs, convert base-16 to base-10.
#FF5733: FF=255, 57=87, 33=51
RGB to Hex: Convert each 0-255 to 2-digit hex.
255=FF, 87=57, 51=33 = #FF5733
Common Colors
| Color | Hex | RGB |
|---|---|---|
| White | #FFFFFF | 255,255,255 |
| Black | #000000 | 0,0,0 |
| Red | #FF0000 | 255,0,0 |
| Green | #00FF00 | 0,255,0 |
| Blue | #0000FF | 0,0,255 |
| Yellow | #FFFF00 | 255,255,0 |
| Orange | #FF8C00 | 255,140,0 |
| Purple | #800080 | 128,0,128 |
Examples
Example 1: #3498DB = rgb(52,152,219)
Example 2: rgb(0,99,219) = #0063DB
Example 3: #F00 = #FF0000 = rgb(255,0,0)
Color Tips
Shorthand: #FC0 = #FFCC00 when digits repeat.
Primaries: #FF0000=red, #00FF00=green, #0000FF=blue.
Equal RGB = gray. rgb(200,200,200) = light gray.
# is optional in most tools.
Frequently Asked Questions
What is the difference between hex and RGB color codes?
Can I use 3-digit hex codes?
What about transparency and RGBA?
How do I find the hex code of a color on my screen?
What is the difference between RGB and CMYK?
Why do some hex codes start with # and others do not?
Related Calculators
Binary to Decimal Converter
Free binary to decimal converter. Convert binary to decimal and h...
Percentage Calculator
Free percentage calculator. Calculate what percent of any number ...
Aspect Ratio Calculator
Free aspect ratio calculator. Find the aspect ratio of any image ...
Cooking Converter
Free cooking measurement converter. Convert between cups, tablesp...