Base Systems


Decimal has 10 digits which are 0,1,2,3,4,5,6,7,8,9. Decimal is also called base 10 because it has 10 digits. We count in decimal because it has 10 digits, we have 10 fingers, and people used to use their fingers for counting.




Binary has 2 digits which are 0 and 1. Binary is also called base 2. Computers use binary for counting because inside a computer there are switch-like things that can be either off or on(0 or 1).



This is 9 in decimal.


The word hexadecimal consists of 2 parts, hex(6) and decimal(10). By adding 6 and 10 together, you get 16. This is the number of digits there are in hexadecimal. Hexadecimal is sometimes called hex or base 16. We use the letters of the alphabet in order to get 16 digits. The 16 digits are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. Hexadecimal is often used instead of binary numbers because just 2 hexadecimal digits can make the same numbers as 8 binary digits which in turn make up a byte. Conversion from binary to hexadecimal, and from hexadecimal to binary, is very easy.



This is 15912 in decimal.


Octal has 8 digits which are 0,1,2,3,4,5,6,7. Octal is also called base 8. Conversion from binary to octal, and from octal to binary, is very easy.



This is 2537 in decimal.

Converting Between Bases

Convert from Base n to Base 10

If there is a number in base n, multiply the digit farthest to the right by n to the zero power. Then, multiply the digit immediately proceeding the digit farthest to the right by n to the first power. As you keep moving one digit further to the left, you need to increase the power of n by one. If there are x digits in the number in base n, the digit furthest to the left should end up being multiplied by n to the power of x - 1. Add the sum of all of the numbers you obtained by multiplication to convert from base n to base 10.


432(from base 5 to base 10)
2*(5^0) + 3*(5^1) + 4*(5^2)
2*1 + 3*5 + 4*25
2 + 15 + 100
117(base 10)

Convert from Base 10 to Base n

The fastest and most efficient way to convert from decimal to binary is by dividing by 2 and keeping track of the remainder. We stop when the quotient = 0. Then read the numbers starting from the bottom up to get the binary number.

For example, to convert 156 from decimal to binary we do:

156 / 2 = 78 r = 0
78 / 2 = 39 r = 0
39 / 2 = 19 r = 1
19 / 2 = 9 r = 1
9 / 2 = 4 r = 1
4 / 2 = 2 r = 0
2 / 2 = 1 r = 0
1 / 2 = 0 r = 1

Thus by reading the numbers starting from the bottom we get, 10011100

Quick Conversion Between Binary and Octal or Hexadecimal

The quickest and most convenient way to convert from binary to octal or hexadecimal and vice versa, is to group three binary digits for every octal digit and four binary digits for every hexadecimal digit. Since three binary digits gives us eight unique combination, we can use each combination to stand for the eight octal digits: 0,1,2,3,4,5,6,7. Likewise, four binary digits hold sixteen different combination for hexadecimal digits 0-F. So we can now convert messy binaries into more concise hexadecimal or octal groups.


Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License