RGB to Hex

Search Engine Optimization

RGB to Hex

Enter red, green and blue color levels (0-255) and press the Convert button:

Red color (R):
Green color (G):
Blue color (B):
Color preview:
Hex color code:
RGB color code:
HSL color code:

About RGB to Hex

RGB to Hex Converter

RGB to Hex Converter takes input in the form of values for Red, Green, and Blue ranging from 0 to 255 and then converts those values to a hexadecimal string that can be used to specify color in html/css code. 


RGB color space

RGB color space or RGB color system, constructs all the colors from the combination of the Red, Green and Blue colors.

The red, green and blue use 8 bits each, which have integer values from 0 to 255. This makes 256*256*256=16777216 possible colors.

RGB ≡ Red, Green, Blue

Each pixel in the LED monitor displays colors this way, by combination of red, green and blue LEDs (light emitting diodes).

When the red pixel is set to 0, the LED is turned off. When the red pixel is set to 255, the LED is turned fully on.

Any value between them sets the LED to partial light emission.


Calculation Examples

White RGB Color

White RGB code = 255*65536+255*256+255 = #FFFFFF

Blue RGB Color

Blue RGB code = 0*65536+0*256+255 = #0000FF

Red RGB Color

Red RGB code = 255*65536+0*256+0 = #FF0000

Green RGB Color

Green RGB code = 0*65536+255*256+0 = #00FF00

Gray RGB Color

Gray RGB code = 128*65536+128*256+128 = #808080

Yellow RGB Color

Yellow RGB code = 255*65536+255*256+0 = #FFFF00


RGB color table - Basic Colors

Color | HTML/CSS |



  Black #000000 (0,0,0)
  White #FFFFFF (255,255,255)
  Red #FF0000 (255,0,0)
  Lime #00FF00 (0,255,0)
  Blue #0000FF (0,0,255)
  Yellow #FFFF00 (255,255,0)
  Cyan #00FFFF (0,255,255)
  Magenta #FF00FF (255,0,255)
  Silver #C0C0C0 (192,192,192)
  Gray #808080 (128,128,128)
  Maroon #800000 (128,0,0)
  Olive #808000 (128,128,0)
  Green #008000 (0,128,0)
  Purple #800080 (128,0,128)
  Teal #008080 (0,128,128)
  Navy #000080 (0,0,128)



Create a free website with GoDaddy!