Hex to RGB converter
Type or paste a hex code to get its RGB values.
How hex to RGB works
A hex code is three two-digit numbers written in base 16: red, green, then blue. Each pair runs from 00 (0) to FF (255). Converting means reading each pair as a normal number.
Common colors in hex and RGB
| Color | HEX | RGB |
|---|---|---|
| Red | #FF0000 | rgb(255, 0, 0) |
| Green | #008000 | rgb(0, 128, 0) |
| Blue | #0000FF | rgb(0, 0, 255) |
| Black | #000000 | rgb(0, 0, 0) |
| White | #FFFFFF | rgb(255, 255, 255) |
| Gray | #808080 | rgb(128, 128, 128) |
| Navy Blue | #000080 | rgb(0, 0, 128) |
| Teal | #008080 | rgb(0, 128, 128) |
| Sage Green | #9CAF88 | rgb(156, 175, 136) |
| Burgundy | #800020 | rgb(128, 0, 32) |
| Lavender | #E6E6FA | rgb(230, 230, 250) |
| Gold | #FFD700 | rgb(255, 215, 0) |
| Coral | #FF7F50 | rgb(255, 127, 80) |
| Hot Pink | #FF69B4 | rgb(255, 105, 180) |
| Beige | #F5F5DC | rgb(245, 245, 220) |
| Charcoal | #36454F | rgb(54, 69, 79) |
Questions
- How do you convert hex to RGB?
- Split the six digits into three pairs and convert each pair from base 16 to base 10. For #9CAF88: 9C = 9×16 + 12 = 156, AF = 10×16 + 15 = 175, 88 = 8×16 + 8 = 136, so the RGB value is 156, 175, 136.
- What about 3-digit hex codes?
- Double each digit first: #F80 is the same as #FF8800, which is RGB 255, 136, 0.
- What is an 8-digit hex code?
- The last two digits are the alpha (opacity) channel. #9CAF8880 is #9CAF88 at about 50% opacity.
More color tools
- Color pickerPick any color and get its HEX, RGB, HSL and CMYK codes
- RGB to hex converterTurn red, green and blue values into a hex code
- Hex to HSL converterHue, saturation and lightness from a hex code
- Hex to CMYK converterPrint-ready CMYK percentages from a hex code
- Color contrast checkerWCAG contrast ratio for text and background colors
- Color mixerBlend two colors and see every step in between
- Image color pickerUpload a photo and pick colors from it
- CSS gradient generatorBuild a linear or radial gradient and copy the CSS