Skip to content
Bai
EspañolEnglishEuskara Get started →

Tools

RGB to HEX

Convert RGB to HEX

Convert RGB values to a hex code for CSS, design work or brand guides.

Private by design
Enter a valid colour value to see the conversions
HEX#3b82f6
RGB59, 130, 246
Decimal RGB0.2314, 0.5098, 0.9647
HSL217, 91%, 60%
LAB54.5 8.5 -65.5
LCH54.5 66.0 277.5
OKLAB0.64 -0.01 -0.15
OKLCH0.64 0.15 264

About this tool

Convert RGB colours such as rgb(255, 54, 23) into their hexadecimal code, #ff3617. That is what you need when you sample a colour with an eyedropper or from Photoshop and want to paste it into a stylesheet, a WordPress theme or your brand colour sheet, where hex is the norm because it is shorter and easier to share.

RGB is already selected when the page opens. Type the three channels into “Value”: rgb(255, 54, 23) works, and so does plain 255, 54, 23. The hex code is highlighted in the first row of the table and copies with one click. If you would rather pick the colour by eye, click the swatch on the left and use your system picker.

Nothing is uploaded: your browser does the conversion. Each channel must be between 0 and 255; higher values are capped at 255. Transparency is ignored, so if you start from rgba() the resulting hex is the opaque colour. For percentages or 0–1 values, choose “Decimal RGB” in the menu.

Frequently asked questions

How do you convert RGB to hex without a tool?

Convert each channel from decimal to two-digit hexadecimal and join them: 255 = FF, 54 = 36 and 23 = 17, so rgb(255, 54, 23) is #FF3617.

The result is lower case — is that a problem?

No. #ff3617 and #FF3617 are the same colour, and CSS, Figma and any other app accept both.

What happens to the alpha in rgba()?

The alpha channel is not converted; you get the opaque base colour. If you need transparency, keep rgba() in CSS or add two alpha digits to the hex code.

Why does my Photoshop RGB colour look different on the web?

Your document may use a colour profile other than sRGB, such as Adobe RGB. Convert the document to sRGB before reading the values.

Related tools