About RGB to HEX Tool
RGB to HEX conversion: each R, G, B channel (0–255) is converted to a 2-digit hexadecimal value (00–FF) and concatenated with a # prefix. rgb(255, 87, 51) → #FF5733.
To convert RGB to HEX: convert each of R, G, B from decimal to 2-digit hex. rgb(255, 87, 51) → FF, 57, 33 → #FF5733.
RGB to HEX converts CSS rgb() or rgba() values to their 6-digit (or 8-digit with alpha) hexadecimal color codes. This is useful when a design specification gives RGB values but your stylesheet, SVG, or tool requires HEX format.
Key Features
- Converts rgb(r,g,b) to #RRGGBB HEX format.
- Converts rgba(r,g,b,a) to #RRGGBBAA 8-digit HEX format.
- Accepts values 0–255 for each channel.
- One-click copy of the hex code.
- Browser-based — no data sent anywhere.
How to Use the Tool
- Enter the Red, Green, and Blue values (each between 0 and 255).
- The 6-digit HEX code appears instantly.
- Click 'Copy' to copy the #HEX code to your clipboard.
Core Benefits
- Convert design specs from Figma or Sketch (RGB) to CSS HEX format.
- Required when a tool or library only accepts HEX color codes.
- Shorter to type than rgb() in most CSS contexts.
Common Use Cases
- A developer converting Figma color values (shown as RGB) to HEX for CSS.
- Converting JavaScript canvas RGB values to HEX for SVG attributes.
- Getting the HEX code from an RGB value in a photo editor.
Pro Tips
- 255 in decimal = FF in hexadecimal. 128 in decimal = 80 in hexadecimal. 0 = 00.
- CSS HEX codes are case-insensitive: #FF5733 and #ff5733 are identical.
- 3-digit HEX shorthand exists for symmetric colours: #FF5533 = #F53 (each pair must match).
Use this free RGB to HEX converter to get the HEX color code for any RGB value. Works for both rgb() and rgba() with alpha channel support.