RGB to Hex

Enter RGB color values and convert them to a hex color code. See a live color preview and generate random colors.

RGB Color
Red (R)
Green (G)
Blue (B)
Values from 0 to 255 per channel
Hex Code
Result will appear here
Preview

RGB to Hex Converter

This tool converts RGB (Red, Green, Blue) color values into their hexadecimal color code equivalent. It includes a live color preview so you can see exactly what the color looks like. The random color button generates a new color each time.

The conversion runs entirely in your browser. Enter values from 0 to 255 for each color channel.

How to use

  1. Enter values from 0 to 255 for Red, Green, and Blue.
  2. Click Convert to see the hex color code and preview.
  3. Click Random to generate a random color.
  4. Use Copy to copy the hex value to your clipboard.

What is RGB?

RGB is a color model that represents colors by combining red, green, and blue light. Each channel has a value from 0 (no intensity) to 255 (full intensity). By mixing different amounts of each primary color, you can create any visible color on a screen.

Example

RGB: rgb(255, 87, 51)
Hex: #FF5733

RGB: rgb(0, 255, 0)
Hex: #00FF00

RGB: rgb(51, 102, 204)
Hex: #3366CC