Something wrong with this tool?
About HEX To RGB Converter Online
This tool converts hexadecimal color codes (#FF5733) to RGB notation (rgb(255, 87, 51)) and back. Both formats represent the same colors, but different tools and contexts prefer different formats — hex is concise for CSS, RGB is more readable when working with sliders or sliders programmatically.
The converter handles 6-digit hex (#FF5733), 3-digit shorthand (#F53 for #FF5533), and 8-digit hex with alpha channel (#FF5733FF). Output is offered in both rgb() and the modern rgb(r g b / a) function syntax.
Useful when porting designs between tools (Figma may show hex, code expects rgb), debugging visual differences in CSS, or building tools that work with both formats.
How to use this tool
How to convert a hex color to RGB
Enter the hex code
Drop the hex value into the "Hex (#RGB or #RRGGBB)" field. The leading `#` is optional and case doesn't matter — `#FF00aa` and `ff00aa` work equally.
Shorthand 3-digit expansion
Three-digit hex is auto-expanded by doubling each digit: `#abc` becomes `#aabbcc` before parsing. Any length other than 3 or 6 valid hex digits is rejected with a clear error.
Press Run
Result returns `r`, `g`, `b` (each 0–255), `rgbCss` (the ready-to-paste `rgb(r, g, b)` string), and `hex` (the normalised lowercase 6-digit form).
Use the rgbCss field directly
rgbCss is formatted exactly how browsers expect it in inline styles. Copy it into your stylesheet, design tool, or component prop with no extra editing.