# Convert HEX to RGB

> Convert HEX color codes to RGB online. Free HEX to RGB converter with a worked example and a live color picker with contrast checking.

RGB values are what you need for rgba() transparency, canvas drawing, and many design tools. This converter turns hex color codes into their red, green, and blue components, supporting both 3- and 6-digit hex.

## Example: HEX → RGB

Input:
```
#c0392b
#1dd1a1
#54a0ff
```

Output:
```
rgb(192, 57, 43)
rgb(29, 209, 161)
rgb(84, 160, 255)
```

## How to convert HEX to RGB

1. Take your hex code, e.g. #c0392b.
2. Split it into pairs: c0, 39, 2b.
3. Convert each pair from hexadecimal to decimal to get rgb(192, 57, 43).

## FAQ

### How do I convert a 3-digit hex like #abc?

Each digit is doubled: #abc becomes #aabbcc, which is rgb(170, 187, 204). The converter expands shorthand hex automatically.

### How do I add transparency?

Once you have the RGB values, use rgba(r, g, b, a) where a is an alpha between 0 (transparent) and 1 (opaque).

## Related converters

- [RGB → HEX](https://www.devkult.com/convert/rgb-to-hex.md)
- [HEX → HSL](https://www.devkult.com/convert/hex-to-hsl.md)
- [RGB → HSL](https://www.devkult.com/convert/rgb-to-hsl.md)

Open the interactive converter: https://www.devkult.com/convert/hex-to-rgb