About HEX to RGB Tool
HEX color codes are 6-digit hexadecimal values (#RRGGBB) representing red, green, and blue intensities from 00 to FF. RGB is the decimal equivalent: R, G, B each ranging from 0 to 255.
To convert HEX to RGB: split the 6-digit code into pairs and convert each pair from hex to decimal. #FF5733 → FF=255, 57=87, 33=51 → rgb(255, 87, 51).
HEX to RGB converts HTML/CSS hex color codes into their RGB (and RGBA) decimal equivalents. Enter any valid HEX code — 3-digit shorthand (#FFF), 6-digit (#FF5733), or 8-digit with alpha (#FF573380) — and get the rgb() or rgba() CSS value ready to use.
Key Features
- Converts 3-digit, 6-digit, and 8-digit (alpha) HEX codes.
- Shows rgb() and rgba() output in CSS-ready format.
- One-click copy of the RGB value.
- Also shows the reverse: RGB to HEX.
- Browser-based — no data sent anywhere.
How to Use the Tool
- Enter a HEX color code with or without the # prefix.
- The rgb() and rgba() values appear instantly.
- Click 'Copy' to copy the CSS rgb() value.
Core Benefits
- Needed when CSS frameworks or libraries require rgb() format instead of HEX.
- Required for canvas drawing API: ctx.fillStyle = 'rgb(255, 87, 51)'.
- Useful for programmatic color manipulation in JavaScript.
Common Use Cases
- Converting a design tool's HEX colour to CSS rgb() for use in JavaScript.
- Using RGB values in HTML canvas fill/stroke operations.
- Adding transparency to an existing HEX colour by getting the RGB values and using rgba().
Pro Tips
- 3-digit HEX is a shorthand: #FFF = #FFFFFF, #F53 = #FF5533.
- To add transparency to a HEX colour, convert to RGBA: rgb(255, 87, 51) → rgba(255, 87, 51, 0.5) for 50% opacity.
- CSS now supports HEX with alpha directly: #FF573380 (last two digits = opacity in hex).
Use this free HEX to RGB converter to quickly get the RGB or RGBA value of any HEX color code. Includes 3-digit, 6-digit, and alpha-channel 8-digit support.