My Learning

Keep this for later

Sign in or create a free account to save it. You’ll return to this page afterward.

Sign inCreate an account

HEX to RGB

Convert a three- or six-digit hex color into decimal RGB channels.

Use #RGB or #RRGGBB.

How to use this tool

Enter #RGB or #RRGGBB and process the color.

Important to know

Convert a three- or six-digit hex color into decimal RGB channels.

Alpha channels and named CSS colors are not supported.

Formula and methodology

Expand each one-digit channel if needed, then convert each base-16 channel pair to decimal.

Example

#FF0080 becomes rgb(255, 0, 128).

Frequently asked questions

How does #F08 expand?

Each digit is doubled: #F08 becomes #FF0088.