HEX to RGB
FreeConvert HEX color codes to RGB values
rgb(99, 102, 241) rgba(99, 102, 241, 1)
About HEX to RGB
Design tools and brand guides hand you HEX colors, but CSS features like rgba() transparency, canvas drawing, and many libraries need the RGB channel values instead. Doing the base-16 math in your head for each color is a needless distraction. This converter takes a HEX code and returns its red, green, and blue values so you can plug them straight into your styles or code.
Enter a HEX color, with or without the leading hash, and the tool splits it into its three channels and outputs the RGB values. It is free, runs in your browser, needs no signup, and returns the result instantly. It accepts both the full six-digit form and the shorthand three-digit form, expanding the shorthand correctly before computing the channels.
Common uses
- Converting a brand HEX color into RGB for an rgba() value with opacity
- Getting RGB channels for use in canvas or WebGL code
- Translating a design tool's HEX output into RGB for a library that needs it
- Building a color with transparency from a solid HEX value
- Checking the individual red, green, and blue components of a color
How to use
- 1
Configure options
Set your preferences using the options panel below.
- 2
Click Generate
Click the process button to generate your result instantly.
- 3
Copy or download
Copy the result to clipboard or download it directly to your device.
Why ToolHub?
- Accurate conversion
- Multiple formats
- Instant results
FAQ
Does it accept shorthand HEX like #f00?
Yes. Three-digit shorthand is expanded to its six-digit form before the RGB channels are calculated.
Is the leading # required?
No. You can include or omit the hash; the tool parses the hex digits either way.
What about an alpha channel?
This converts the RGB channels. For eight-digit HEX with alpha, the extra pair represents opacity, which you handle separately in rgba().
What range are the values?
Each channel is returned as an integer from 0 to 255, the standard range for RGB in CSS.
Can I use HEX to RGB on mobile?
Yes — ToolHub is fully responsive and works on iPhone, Android, tablets and all modern browsers. No app install needed.