How to convert RGB to HEX
- Enter the red, green and blue values (0–255), and optionally alpha (0–1).
- Or pick a color with the color picker.
- The HEX code appears instantly with a preview. Copy it, or the RGB or HSL value.
Examples
| RGB | HEX |
|---|---|
| rgb(255, 255, 255) | #FFFFFF |
| rgb(255, 94, 77) | #FF5E4D |
| rgb(14, 11, 16) | #0E0B10 |
| rgba(91, 43, 130, 0.5) | #5B2B8280 |
Why use HEX?
HEX codes are compact, easy to copy and supported everywhere — in CSS, design tools like Figma, brand guidelines and HTML attributes.
Frequently asked questions
How do I convert RGB to HEX manually?
Convert each channel from decimal to a two-digit hexadecimal number and join them. rgb(255, 94, 77) → FF, 5E, 4D → #FF5E4D.
What range do RGB values use?
Each channel is a whole number from 0 to 255. Alpha (opacity) ranges from 0 (transparent) to 1 (opaque).
How is alpha converted?
When alpha is below 1, an extra pair of digits is added: alpha × 255 in hex. rgba(255, 0, 0, 0.5) becomes #FF000080.