[an error occurred while processing this directive]

Hex Numbering

Hex is the numbering system most used by computer programmers. There are a lot of reasons why hex is so popular.

This document will explain what the Hex numbering system is, and how it applies.

In Hex there are 16 relevant characters that make up the numbering system. This is also called a base 16 numbering system.

The digits in the Hex number system are:

0 1 2 3 4 5 6 7 8 9 A B C D E F

Decimal (our standard, base 10, number system) uses only 0 through 9, therefore the letters are necessary. You can convert between decimal and hex fairly easily. The way Hex relates to Decimal can be illustrated as:

Second digit
Hex
0 1 2 3 4 5 6 7 8 9 A B C D E F
F
i
r
s
t

D
i
g
i
t
H
e
x
00123456789101112131415
116171819202122232425262728293031
232333435363738394041424344454647
348495051525354555657585960616263
464656667686970717273747576777879
580818283848586878889909192939495
696979899100101102103104105106107108109110111
7112113114115116117118119120121122123124125126127
8128129130131132133134135136137138139140141142143
9144145146147148149150151152153154155156157158159
A160161162163164165166167168169170171172173174175
B176177178179180181182183184185186187188189190191
C192193194195196197198199200201202203204205206207
D208209210211212213214215216217218219220221222223
E224225226227228229230231232233234235236237238239
F240241242243244245246247248249250251252253254255

Hex is primarily used because It can easily represent several different numbers. In hex, You will only need 6 digits to represent a color code, because the number represents all the possible combinations of color codes. This relates directly to how computers store numbers, specifically how big each number can be per a unit of memory. Most computers have a standard unit system for storing information. This is a byte. It represents 8 "bits" which can be either 0 or 1. There are 256 possible combinations of bits in a byte. Each Hex digit corresponds to 4 binary bits, this means that 2 Hex digits can represent 8 bits. Here is a table of how Hex relates to Binary:


Hex 0 1 2 3 4 5 6 7 8 9 A B C D E F
Binary 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

As you can see, Hex can be used to easily represent bit patterns. The reason Hex is used most often is because it can represent large numbers in a visually compact format.

[an error occurred while processing this directive]