Turn RGB values into a HEX code
Enter red, green and blue values from 0 to 255 — or drag the sliders — and the converter shows the matching HEX code in large type with a copy button. Add an alpha value below 1 to get an 8-digit HEX (like #3b82f6cc) for semi-transparent colors.
The same color is also shown in HSL, OKLCH, HSV, CMYK and decimal, with a live swatch and a WCAG contrast check for white and black text.
How to convert RGB to HEX
- 1
Enter the R, G and B values
Each from 0 to 255, or use the sliders.
- 2
Set the alpha if needed
1 is fully opaque.
- 3
Copy the HEX code
Or any other format below.
Key features
Sliders and inputs
Type exact values or explore visually.
Alpha channel
Outputs 8-digit HEX and rgba().
Every format
HSL, OKLCH, HSV, CMYK and decimal as well.
Contrast check
WCAG ratios for white and black text.
Common uses
- Design handoff: Convert RGB values from Photoshop or Figma into HEX for CSS.
- Brand guidelines: Document colors in both formats.
- Data visualization: Turn RGB palettes into HEX codes for charting tools.
Tips and good to know
- Each HEX pair is one channel in base 16: 255 is FF and 0 is 00.
- Starting from a HEX code? Use the HEX to RGB Converter.
