Colour converter

What's the difference between RGB and hex colours?

RGB and hex are two formats used to define colours digitally, but they serve different contexts and use different numerical systems. RGB stands for red, green and blue — the three base colours of light that combine to produce all other colours on screens. It's expressed as a set of three numbers, like rgb(255, 0, 0) for red. Hexadecimal (hex) colours are six-digit codes used primarily in web design, prefixed with #, such as #FF0000 for the same red.

RGB is often used in image editing, graphic design software or programming environments where direct manipulation of light values is needed. Hex is compact and better suited for HTML, CSS and general web development, where character count and readability matter. Both refer to the same colour space but present the values differently — decimal versus base-16 encoding.

How does this converter work?

This tool instantly translates between the two formats. Enter either a hex code or an RGB value, and it outputs the corresponding equivalent. There's no need to calculate manually or memorise conversion formulas—just input and get the result.

How do RGB numbers work?

RGB values define the intensity of red, green, and blue light used to compose a colour. Each component is a number between 0 and 255, where:

  • 0 means no contribution of that colour
  • 255 means full intensity

White is created by combining all three at their maximum values: rgb(255, 255, 255). Black results from all three being zero: rgb(0, 0, 0). By adjusting these numbers, you can create over 16 million possible colours.

Use the RGB boxes above to experiment. Watch how different combinations affect the resulting hue, brightness and saturation.