The hexadecimal code is the number code of a color. The hexadecimal (hex) code of each color is six digits long. To understand the way it works, you must first learn a new way of counting. When you count from one to ten, you are using a system of counting called base ten.
Base ten uses ten numbers which are: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
Since we only use ten numbers in base ten, to get 16 numbers, we use the ten numbers we are used to; 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 plus six letters which are: A, B, C, D, E, and F. The first ten numbers in hexadecimal are the same as the first ten numbers in base ten; 0 thru 9. But the number 10 in base ten becomes the letter A in hexadecimal and the number 11 is B, 12 is C, 13 is D, 14 is E, and 15 is F.
When you count from 0 to nine, in base ten, you've used up all ten numbers, so you add a "tens" place by putting a one next to a zero and the next number becomes 10. Then you can count up to 19 before the one becomes a two for 20. The two stands for two tens, since it is in the "tens" place.
When we get to the number 16 in hexadecimal, we've used up all the hexadecimal numbers(0 thru 9 and A thru F). So just like you added a "tens" place in BASE 10, you add a "sixteen's" place in hexadecimal and the number 16 becomes 10 in hexadecimal. The one represents the number of "sixteen's" that there are. So 20 in hexadecimal tells us that there are 2 "sixteen's" because the 2 is in the "sixteen's" place. So the hexadecimal number 20 corresponds to the number 32 in base ten. (Two "sixteen's")
The hexadecimal number 30 tells us that there are 3 "sixteen's" since the 3 is in the "sixteen's" place. Since 3 times 16 equals 48, the hexadecimal number 30 corresponds to the base ten number 48.
A three digit number in base ten shows the "hundredth's" place. For example, the number 4 in 456 tells us that there are four "hundreds", five "tens", and six "one's". If we add them together, we get 456. The "hundreds" place corresponds to 10 X 10 or 10 to the second power. (Ten squared). A thousand is 10 x 10 x10 or ten to the third power. (Ten Cubed). Every time we add another place, we multiply it by another ten. Ten thousand is 10 X 10 X 10 X 10.
In base 16 or hexadecimal, the second digit corresponds to the "sixteen's" place rather than the "tens" place. A three digit hexadecimal number shows the "256ths" place which corresponds to 16 X 16 or 16 to the second power (Sixteen Squared) instead of the "hundreds" place in base ten. The 3 in the hexadecimal number 300 is the number of the "256ths" place. Since 3 x 256 equals 768, the hexadecimal number 300 converts to the base ten number 768. In the hexadecimal number 456, the 4 is in the "256ths" place, the 5 is in the "16ths" place, and the 6 is in the "1's" place. So to convert it into base ten, you multiply the number by it's "place" and add them together. So the hexadecimal number 456 is 4 X 256 (1024) plus 5 X 16 (80) plus 6 X 1 (6). When added 1024+80+6=1110. So the hexadecimal number 456 is the same as the base ten number 1110.
If we were to add a fourth place in hexadecimal, it would correspond to 16 X 16 X 16 (16 X 16 X 16=4096). So in the hexadecimal number 1000, the one is in the "4096ths" place. The hexadecimal number 1000 therefore converts to 4096 in base ten. The hexadecimal number FFFFFF converts to 16,777,215 in base ten.. That number plus one more for zero equals 16,777,216 which is the total number of colors that can be made using the three RGB codes.
Now let's see if you understand the base sixteen hexadecimal numbers. Take the hexadecimal quiz by clicking here. When you're finished with the quiz, return back to this page.
The hexadecimal code is a way to number all of the different colors which can be made by the various RGB combinations. The Hex code starts at zero. Zero is the number for the color "black" in hexadecimal or 000000. Black is the first of the 16,777,216 different colors which can be viewed on modern computers. The base ten number for black is also zero. Black is actually composed of no colors at all. It is the absence of color.
The last color is color number 16,777,215 which corresponds to FFFFFF in hexadecimal. This color contains the maximum amount of all three colors. The color is "white". If you want to learn more about color and how your computer displays color, click here. You will learn that white light is composed of all the colors combined together. Then take a look at the Hexadecimal Table. The hexadecimal table lists all of the hexadecimal numbers from 0 to 255 for a total of 256 numbers.(255 plus one for 0). Notice that the number 256 (or FF in hexadecimal) is the same as the second hexadecimal place as discussed above, the "256th's " place.(16 X 16= 256). So once you get to 255, it's like getting to 99 in base ten. To count higher, you have to add a third digit to the number. So the hexadecimal number for 256 is 100. But since the three RGB code numbers only go up to 255, there is no need for the third hexadecimal digit.The three RGB numbers each go from 0 to 255 so only two hexadecimal digits are needed to convert each of them from base ten into hexadecimal. By using six hexadecimal digits, all possible combinations of the three RGB colors can be numbered. The first two hexadecimal digits code for red, the next two code for green, and the last two code for blue.
With the Hexadecimal Converter you can convert the hexadecimal code of any color into it's RGB code. To convert any Hexadecimal number into a Decimal number, use the Decimal to Hexadecimal Converter. When you're sure you understand what hexadecimal means, click here to learn about RGB codes.
Now you're probably wondering why hexadecimal numbers are used instead of the RGB numbers or regular base ten numbers. The reason is that the RGB code uses nine digit numbers to represent the different colors while hexadecimal uses only six.
Also, with regular numbering, you can't easily determine how much red, green, and blue there is in each color as you can with the hexadecimal approach. When the computer reads the hexadecimal number of a color, it knows that the first two digits code for red, the second two code for green, and the third two code for blue. Then it varies the intensity of the three lights on your monitor to create the color.
To learn more about the hexadecimal code and the technical reasons for why it is used go to the Links page which lists many websites you can go to to learn more.