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
Type a hex code with or without #, 3 or 6 digits (F60 or FF6600). A plain decimal such as 16739125 also works.
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: type it into the color code field (for example #FF6B35 or FF6B35), leave the 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
Can I type a hex code directly?
What is the difference between RGB and HSL?
What is WCAG contrast ratio?
Can I use the output directly in CSS?