fbe University of New South Wales Sydney Australia UNSW
Faculty of the Built Environment search

Hexadecimal Colour Numbers

As you probably know computers know about 0's and 1's. These bits are grouped into bytes - which are 8 bits. Hexadecimal notation was developed as a convenient way of representing bytes. Each dexadecimal has 16 posible values (0 to 15).

In base 10 mathematics 24 is 2x10 + 4.
In base 16 mathematics 24 is 2x16 + 4 (36 decimal).
In base 16 mathematics BC is 11x16 + 12 (188 decimal).

Each 8 bit byte has 256 posible values (0 to 255), which can be represented with two dexadecimals.

Now let's get back to Hexadecimal Colour Numbers, they take the form: "#rrggbb", where rr, gg, and bb are Hexadecimal numbers representing Red, Green and Blue respectively.

For example: "#ffffff" is White, "#ff0000" is Red, "#00ff00" is Green, and "#0000ff" is Blue.

When the colour value is 0 that colour does not contribute to the resulting colour, so black is "#000000". When the colour value is 255 ("ff") the colour is "on full", so "#ff87ff" is Red(256),Green(135) and Blue(255) - which is pink.


The table below can be used to convert to and from Hexadecimal.
The column (C) is placed before the row (R), for example to convert
135 to Hexadecimal, find it in the table... it's in column 8, row 7,
therefore 135 = 87 Hexadecimal.
C
01234567 89ABCDEF
R 00163248648096112128144160176192208224240
11173349658197113129145161177193209225241
22183450668298114130146162178194210226242
33193551678399115131147163179195211227243
442036526884100116132148164180196212228244
552137536985101117133149165181197213229245
662238547086102118134150166182198214230246
772339557187103119135151167183199215231247
882440567288104120136152168184200216232248
992541577389105121137153169185201217233249
A102642587490106122138154170186202218234250
B112743597591107123139155171187203219235251
C122844607692108124140156172188204220236252
D132945617793109125141157173189205221237253
E143046627894110126142158174190206222238254
F153147637995111127143159175191207223239255

Web document by Stephen Peter, S.Peter@unsw.edu.au, last updated 16 Jul 95.