Colour Tools

HEX to RGB

All tools

Paste a hex code and copy the matching rgb() value in one click.

How it works

Four simple steps

1

Enter the hex code

Type #RGB, #RRGGBB or #RRGGBBAA, with or without the hash.

2

Check the swatch

The preview and status update once the code is valid.

3

Read the channels

R, G and B appear as numbers from 0 to 255.

4

Copy rgb()

Copy RGB gives you a ready-to-paste CSS value.

HEX to RGB

About HEX to RGB

A brand guide lists colors as hex codes, but you need rgba() so you can add transparency to an overlay. Paste the hex value here and copy the RGB numbers, ready for an alpha channel.

Type or paste the hex code into the HEX box, with or without the leading #. Three-digit shorthand like #f80 is expanded to #ff8800 before converting, and an eight-digit code is accepted with its alpha pair ignored. The status line shows the conversion, and Copy RGB puts a CSS-ready rgb(r, g, b) string on the clipboard. The R, G and B fields show each channel from 0 to 255 if you want them separately.

Input that is not valid hex, such as a code with a stray letter g or the wrong number of digits, is simply not applied, and the previous color stays on screen. If the swatch does not change while you type, check the code. To make a translucent version, copy the RGB value and add a fourth number: rgb(59, 130, 246) becomes rgba(59, 130, 246, 0.5) for 50 percent opacity.

The side table also lists HSL, HSV, OKLCH and CMYK. Going the other way? Use the RGB to HEX converter. For more input formats in one place, the universal color converter copies every format at once. Conversion is simple arithmetic run by your browser.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Each digit is doubled, so #f80 becomes #ff8800, which is rgb(255, 136, 0).

It is dropped and the color is treated as fully opaque. Add the alpha back yourself by writing an rgba() value with the opacity you need.

The value only applies once it is a complete, valid hex code of 3, 6 or 8 digits. Until then the last valid color stays on screen.

View more FAQs

Related tools

View all

Color Picker

Pick and convert colors.

Open

RGB to HEX

Convert RGB to HEX.

Open

Color Converter

Convert between color spaces.

Open

Palette Generator

Generate color palettes.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools