Colour Tools

RGB to HEX

All tools

Type three channel values and copy the uppercase hex code that matches.

How it works

Four simple steps

1

Enter RGB values

Type red, green, and blue integers from 0–255.

2

Clamp out-of-range

Values outside 0–255 are normalized or flagged.

3

Build hex code

Channels pad to two digits and join as #RRGGBB.

4

Copy hex color

Copy the hex string for palettes or Figma.

RGB to HEX

About RGB to HEX

A color picker in a desktop app gave you R 34, G 197, B 94, and the stylesheet wants a hex value. Enter the three numbers here and copy #22C55E back.

Enter red, green and blue in the three number fields, each from 0 to 255. Values outside that range are clamped, so 300 becomes 255 and a negative number becomes 0. You can also paste a whole rgb(34, 197, 94) string, or just "34, 197, 94", into the HEX box and it converts the same way. Each channel becomes a two-digit hex pair, and the result is shown in uppercase, which Copy HEX puts on your clipboard.

If you start from rgba() with transparency, keep in mind the hex output is always six digits, without an alpha pair. For a translucent color in CSS, either keep the rgba() value or add the alpha as two extra hex digits yourself (80 is roughly 50 percent). Decimal channel values are rounded to the nearest whole number before conversion.

Alongside the hex result you also get HSL, HSV, OKLCH and CMYK in the side table. For the reverse direction, open HEX to RGB. Once you have the code, see whether it reads well on light or dark backgrounds with the color contrast checker. The math runs entirely in 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.

Uppercase is just a display choice. Hex colors are not case-sensitive, so #22C55E and #22c55e are the same color in CSS.

The color part converts, but the alpha is not included in the six-digit hex output. Keep the rgba() value, or append two hex digits for the alpha yourself.

It is clamped to 255, and negative numbers are clamped to 0, so the result is always a valid color.

View more FAQs

Related tools

View all

Color Picker

Pick and convert colors.

Open

HEX to RGB

Convert HEX to RGB.

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