Hex to RGB Converter

Convert between Hex color codes and RGB values for web development.

#
Enter 3 or 6 digit hex code without the # symbol

About Color Codes

Color codes are used in web development and graphic design to represent colors. The two most common formats are Hex (hexadecimal) and RGB (Red, Green, Blue).

Hex Color Codes

Hex color codes use the hexadecimal format to represent colors in HTML, CSS, and other computing applications.

  • Format: #RRGGBB or #RGB
  • Example: #FF5733 (a shade of orange)
  • Each pair of digits represents the intensity of red, green, and blue, ranging from 00 to FF (0 to 255 in decimal)
  • The 3-digit format is a shorthand where each digit is duplicated (e.g., #F53 is the same as #FF5533)

RGB Color Codes

RGB colors specify the intensity of red, green, and blue components of a color using decimal values.

  • Format: rgb(R, G, B)
  • Example: rgb(255, 87, 51) (same orange as the hex example)
  • Each value ranges from 0 to 255
  • Modern CSS also supports rgba(R, G, B, A) where A is the alpha (transparency) value ranging from 0 to 1

Common HTML Color Names

Color Name Hex Code RGB Values Preview
Red #FF0000 rgb(255, 0, 0)
Green #00FF00 rgb(0, 255, 0)
Blue #0000FF rgb(0, 0, 255)
Black #000000 rgb(0, 0, 0)
White #FFFFFF rgb(255, 255, 255)