HEX to RGB
Convert HEX color codes to RGB values.
How to Use HEX to RGB
Type a HEX colour such as #4A90E2 into the input, with or without the leading hash.
Click the "Process" button to see the RGB channel values and the ready-to-paste rgb() string.
Set the alpha slider if you need an rgba() value with transparency.
Copy the rgb() or rgba() string straight into your CSS, inline style, or canvas code.
Features
Frequently Asked Questions
Related Tools
JSON Formatter
Format and beautify JSON data with proper indentation.
JSON Validator
Validate JSON data and find syntax errors.
JSON Minifier
Minify JSON by removing whitespace and formatting.
HTML Formatter
Format and beautify HTML code.
HTML Minifier
Minify HTML code to reduce file size.
CSS Formatter
Format and beautify CSS code.
About HEX to RGB
Design tools hand you HEX, but plenty of code wants channel numbers. A canvas fillStyle, an inline style in an email template, a charting library, an old jQuery colour plugin, and most design token pipelines all expect something like rgb(74, 144, 226) rather than #4A90E2. This converter gives you the exact integers, with no rounding or approximation.
The mapping is simple and exact. A six-digit HEX code is two hexadecimal digits per channel, red then green then blue, and each pair runs from 00 to FF which is 0 to 255 in decimal. So 4A is 74, 90 is 144, and E2 is 226. There is no colour space conversion involved, so the result is precisely the same colour, not an approximation of it.
Shorthand and alpha forms are handled as well. The three-digit form expands to its six-digit equivalent, and an eight-digit value such as #4A90E280 carries an alpha byte you can turn into a ready-made rgba() string. HSL and HSV equivalents are shown too, since the person asking for this is usually a designer who needs to hand the value to a front-end developer.
When to Use This Tool
- Feeding a design tool colour into canvas drawing or a charting library
- Writing an inline style attribute for an email template
- Building a design token file that stores objects with r, g, b channels
- Computing a translucent overlay colour with the alpha channel
- Debugging a colour that renders differently than the HEX value suggests