Developer Tools

HEX to RGB

Convert HEX color codes to RGB values.

How to Use HEX to RGB

1

Type a HEX colour such as #4A90E2 into the input, with or without the leading hash.

2

Click the "Process" button to see the RGB channel values and the ready-to-paste rgb() string.

3

Set the alpha slider if you need an rgba() value with transparency.

4

Copy the rgb() or rgba() string straight into your CSS, inline style, or canvas code.

Features

Accepts six-digit, three-digit shorthand, and eight-digit HEX with an alpha channel
Returns exact 0 to 255 channel values plus a matching rgba() string
Shows HSL and HSV equivalents for designers working in Figma or Photoshop
Displays a live swatch so you can confirm the conversion visually
Uses exact integer arithmetic, never a rounded or approximated result
Handy when a design tool gives HEX but the framework expects rgb()

Frequently Asked Questions

Yes, free with no account and no limits on how many colours you convert. Nothing is uploaded, so unreleased brand palettes stay private.
Yes. Three-digit shorthand like #39F is expanded to its full six-digit equivalent, and eight-digit values with an alpha channel are read and reported as an rgba() string with the correct opacity.
That is the 8-bit range for each channel, giving 256 possible values and 16.7 million colours in total. Values outside 0 to 255 would be clamped by a display anyway, and CSS rgb() syntax technically allows them, but they would be clipped.
Add two more digits to the code, for example #4A90E280, where 80 is the alpha byte. The converter reports that as an alpha of 0.5 and gives you the equivalent rgba(74, 144, 226, 0.5) string.

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