Hex to RGB Converter
Convert hex color codes to RGB values instantly. Also outputs HSL and CSS-ready color values for designers and developers.
ยท CalcFlow Editorial
Enter the 6-digit hex color code as a number (without #). For example, FF6B35 = 16737077 in decimal. Or see the FAQ for how to use this.
Set to 0 to use hex input above. Set a value to build RGB directly.
Results shown are estimates for informational purposes only. Nothing on CalcFlow is financial, tax, legal, or medical advice. Always consult a qualified professional before making important decisions.
What is a Hex to RGB Converter? A hex to RGB converter translates a 6-digit hexadecimal color code (like #FF6B35) into three decimal channel values for Red, Green, and Blue (0-255 each).
Rule of Thumb
#000000 = black (0,0,0) | #FFFFFF = white (255,255,255) | #FF0000 = pure red | #00FF00 = pure green | #0000FF = pure blue.
Example Calculation
#FF6B35 converts to R:255, G:107, B:53 โ an orange tone. In CSS: rgb(255, 107, 53) or hsl(20, 100%, 60%).
Key Facts
- โขHex codes use base-16: digits 0-9 and letters A-F. Each pair of characters represents one 8-bit color channel.
- โขThe first two hex digits = Red, middle two = Green, last two = Blue.
- โขWCAG AA accessibility requires 4.5:1 contrast ratio for normal text against the background color.
How to Use
- To convert a hex code: enter the 6-digit hex value as a decimal number (e.g. #FF6B35 = 16737077), leave RGB fields at 0.
- To convert RGB to hex: enter 0 in the hex field and set Red, Green, and Blue channel values.
- Click Calculate to see hex, RGB, HSL, and CSS values.
- Use the Accessibility result to check if text will be readable on this background color.
Formula
R = (hex >> 16) & 0xFF | G = (hex >> 8) & 0xFF | B = hex & 0xFF | HSL conversion via standard formula| Color Name | Hex Code | RGB Values |
|---|---|---|
| Black | #000000 | rgb(0, 0, 0) |
| White | #FFFFFF | rgb(255, 255, 255) |
| Red | #FF0000 | rgb(255, 0, 0) |
| Green | #00FF00 | rgb(0, 255, 0) |
| Blue | #0000FF | rgb(0, 0, 255) |
| Orange | #FF6B35 | rgb(255, 107, 53) |
| Teal | #0F766E | rgb(15, 118, 110) |
| Gray | #6B7280 | rgb(107, 114, 128) |
Frequently Asked Questions
How do I convert a hex color code to decimal for this calculator?
What is the difference between RGB and HSL?
What is WCAG contrast ratio?
Can I use the output directly in CSS?