Number Systems
There are infinite ways to represent a number. The four commonly associated with modern computers and digital electronics are: decimal, binary, octal, and hexadecimal. 
Decimal (base 10) is the way most human beings represent numbers. Decimal is sometimes abbreviated as dec. 
Decimal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, and so on.
Binary (base 2) is the natural way most digital circuits represent and manipulate numbers. (Common misspellings are "bianary", "bienary", or "binery".) Binary numbers are sometimes represented by preceding the value with '0b', as in 0b1011. Binary is sometimes abbreviated as bin. 
Binary counting goes:
0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, and so on.
Octal (base 8) was previously a popular choice for representing digital circuit numbers in a form that is more compact than binary. Octal is sometimes abbreviated as oct. 
Octal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, and so on.
Hexadecimal (base 16) is currently the most popular choice for representing digital circuit numbers in a form that is more compact than binary. (Common misspellings are "hexdecimal", "hexidecimal", "hexedecimal", or "hexodecimal".) Hexadecimal numbers are sometimes represented by preceding the value with '0x', as in 0x1B84. Hexadecimal is sometimes abbreviated as hex. 
Hexadecimal counting goes:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, and so on.
All four number systems are equally capable of representing any number. Furthermore, a number can be perfectly converted between the various number systems without any loss of numeric value. 
At first blush, it seems like using any number system other than human-centric decimal is complicated and unnecessary. However, since the job of electrical and software engineers is to work with digital circuits, engineers require number systems that can best transfer information between the human world and the digital circuit world. 
It turns out that the way in which a number is represented can make it easier for the engineer to perceive the meaning of the number as it applies to a digital circuit. In other words, the appropriate number system can actually make things less complicated. 

Fundamental Information Element of Digital Circuits
Almost all modern digital circuits are based on two-state switches. The switches are either on or off. It doesn't matter if the switches are actually physical switches, vacuum tubes, relays, or transistors. And, it doesn't matter if the 'on' state is represented by 1.8 V on a cutting-edge CPU core, -12 V on a RS-232 interface chip, or 5 V on a classic TTL logic chip. 
Because the fundamental information element of digital circuits has two states, it is most naturally represented by a number system where each individual digit has two states: binary. 
For example, switches that are 'on' are represented by '1' and switches that are 'off' are represented by '0'. It is easy to instantly comprehend the values of 8 switches represented in binary as 10001101. It is also easy to build a circuit to display each switch state in binary, by having an LED (lit or unlit) for each binary digit. 

Making Values More Compact
"Binary digit" is a little unwieldy to say over and over, so the term was contracted to "bit". Not only is the term "binary digit" a little unwieldy, but so is the length of a binary number, since each digit can only represent one switch. As digital circuits grew more complex, a more compact form of representing circuit information became necessary. 
An octal number (base 8) can be up to 1/3 the length of a binary number (base 2). 8 is a whole power of 2 (23=8). That means three binary digits convert neatly into one octal digit. 
A hexadecimal number (base 16) can be up to 1/4 the length of a binary number. 16 is a whole power of 2 (24=16). That means four binary digits convert neatly into one hexadecimal digit. 
Unfortunately, decimal (base 10) is not a whole power of 2. So, it is not possible to simply chunk groups of binary digits to convert the raw state of a digital circuit into the human-centric format. 
Let's see how to convert a number from binary... 
Binary to all systems

Binary to Octal
An easy way to convert from binary to octal is to group binary digits into sets of three, starting with the least significant (rightmost) digits. 
Binary: 11100101 = 	11 100 101		
	011 100 101	Pad the most significant digits with zeros if necessary to complete a group of three.	
Then, look up each group in a table:
Binary:	000	001	010	011	100	101	110	111	
Octal:	0	1	2	3	4	5	6	7	

Binary =	011	100	101		
Octal  =	3	4	5	= 345 oct	

Binary to Hexadecimal
An equally easy way to convert from binary to hexadecimal is to group binary digits into sets of four, starting with the least significant (rightmost) digits.
Binary: 11100101 = 1110  0101
Then, look up each group in a table:
Binary:	0000	0001	0010	0011	0100	0101	0110	0111	
Hexadecimal:	0	1	2	3	4	5	6	7	
Binary:	1000	1001	1010	1011	1100	1101	1110	1111	
Hexadecimal:	8	9	A	B	C	D	E	F	

Binary =	1110	0101		
Hexadecimal =	E	5	= E5 hex	

Binary to Decimal
They say there are only 10 people in this world: those that understand binary and those that don't. Ha ha. 
If you don't get that joke, you'll need a method to convert from binary to decimal. One method involves addition and multiplication. 

1.	For this example, let's convert the binary number 100110112 to decimal. List the powers of two from right to left. Start at 20, evaluating it as "1". Increment the exponent by one for each power. Stop when the amount of elements in the list is equal to the amount of digits in the binary number. The example number, 10011011, has eight digits, so the list, to eight elements, would look like this: 128, 64, 32, 16, 8, 4, 2, 1 

Write first the binary number below the list.

Here is this step written on paper using the example binary number, 10011011.
2.	3
Draw lines, starting from the right, connecting each consecutive digit of the binary number to the power of two that is next in the list above it. Begin by drawing a line from the first digit of the binary number to the first power of two in the list above it. Then, draw a line from the second digit of the binary number to the second power of two in the list. Continue connecting each digit with its corresponding power of two.

Here is this step written on paper using the example binary number, 10011011.
3.	4
Move through each digit of the binary number. If the digit is a 1, write its corresponding power of two below the line, under the digit. If the digit is a 0, write a 0 below the line, under the digit.

Here is this step written on paper using the example binary number, 10011011.
4.	5
Add the numbers written below the line. The sum should be 155. This is the decimal equivalent of the binary number 10011011. Or, written with base subscripts: 100110112 = 15510

Here is this step written on paper using the example binary number, 10011011. The sum of the bottom row, 155, is its decimal equivalent. Or, written with base subscripts: 100110112 = 15510
5.	6
Repetition of this method will result in memorization of the powers of two, which will allow you to skip step 1.

Decimal to all systems:

Now we’ll convert from decimal to all other systems.

Decimal to binary:

This method is much easier to understand when visualized on paper. It relies only on division by two.
1.	1
For this example, let's convert the decimal number 15610 to binary. Write the decimal number as the dividend inside an upside-down "long division" symbol. Write the base of the destination system (in our case, "2" for binary) as the divisor outside the curve of the division symbol. 
2)156
2.	2
Write the integer answer (quotient) under the long division symbol, and write the remainder (0 or 1) to the right of the dividend. 
2)156   0
   78
3.	3

Continue downwards, dividing each new quotient by two and writing the remainders to the right of each dividend. Stop when the quotient is 0. 
2)156   0
 2)78   0
 2)39   1
 2)19   1
  2)9   1
  2)4   0
  2)2   0
  2)1   1
    0
4.	4
Starting with the bottom remainder, read the sequence of remainders upwards to the top. You should have 10011100. This is the binary equivalent of the decimal number 156. Or, written with base subscripts: 15610 = 100111002 

This method can be modified to convert from decimal to any base. The divisor is 2 because the desired destination is base 2. If the desired destination is a different base, replace the 2 in the method with the desired base. For example, if the desired destination is base 9, replace the 2 with 9. The final result will then be in the desired base. 

Decimal to Octal & Hexadecimal:

You can use the same process describe above to convert the decimal number into Octal & Hexadecimal. 
For Octal:---   Divide the number with 8, as done in binary case. 
For Hexa decimal:-- Divide the number with 12, as done in binary case above (but here remember to write A,B,C,D,E,F instead of 10,11,12,13,14,15 respectively)

16)2500 
16)156  -  4
16)9      -  12

Go from down to top--                   9- 12 – 4
But in hexa replace 12 with C --     9- C- 4

Now equalent of (2500) = 9C4  in Hexadecimal

 Octal Number Conversion

Octal to Binary
Converting from octal to binary is as easy as converting from binary to octal. Simply look up each octal digit to obtain the equivalent group of three binary digits. 
Octal:	0	1	2	3	4	5	6	7	
Binary:	000	001	010	011	100	101	110	111	

Octal  =	3	4	5		
Binary =	011	100	101	= 011100101 binary	

e.g. to convert a number 472 from Octal to Binary. We do:
  Octal =     _4_       _7_      _2_
 Binary =     100       111      010
Write them with each other to complete an equivalent.
                       100111010
472 in Octal is equal to 100111010 in binary.

Octal to Hexadecimal
When converting from octal to hexadecimal, it is often easier to first convert the octal number into binary and then from binary into hexadecimal. For example, to convert 345 octal into hex: 
(from the previous example)
Octal  =	3	4	5		
Binary =	011	100	101	= 011100101 binary	

From end side (right side) make group of four bits & then see their equivalent from Hexa table. Add zeros to left side (if needed to complete the last four pack)
Drop any leading zeros or pad with leading zeros to get groups of four binary digits (bits):
Binary 011100101 = 1110 0101
Then, look up the groups in a table to convert to hexadecimal digits.
Binary:	0000	0001	0010	0011	0100	0101	0110	0111	
Hexadecimal:	0	1	2	3	4	5	6	7	
Binary:	1000	1001	1010	1011	1100	1101	1110	1111	
Hexadecimal:	8	9	A	B	C	D	E	F	

Binary =	1110	0101		
Hexadecimal =	E	5	= E5 hex	
Therefore, through a two-step conversion process, octal 345 equals binary 011100101 equals hexadecimal E5.

Octal to Decimal
The conversion can be performed in the conventional mathematical way, by showing each digit place as an increasing power of 8.
345 octal = (3 * 82) + (4 * 81) + (5 * 80) 
               (3 * 64) + (4 * 8) + (5 * 1)
               229 decimal

Hexadecimal Number Conversion

Hexadecimal to Binary
Converting from hexadecimal to binary is as easy as converting from binary to hexadecimal. Simply look up each hexadecimal digit to obtain the equivalent group of four binary digits. 
Hexadecimal:	0	1	2	3	4	5	6	7	
Binary:	0000	0001	0010	0011	0100	0101	0110	0111	
Hexadecimal:	8	9	A	B	C	D	E	F	
Binary:	1000	1001	1010	1011	1100	1101	1110	1111	

Hexadecimal =	A	2	D	E		
Binary =	1010	0010	1101	1110	= 1010001011011110 binary	

Another e.g.    
Hex  =     __3_     __E__    __8__
Binary =    0010      1110       1000
Write them together to complete the equivalent.=> 010011101000

Hexadecimal to Octal
When converting from hexadecimal to octal, it is often easier to first convert the hexadecimal number into binary and then from binary into octal. For example, to convert A2DE hex into octal: 
(from the previous example)
Hexadecimal =	A	2	D	E		
Binary =	1010	0010	1101	1110	= 1010001011011110 binary	
To complete the pack of three you can add 0’s (if needed). 
Add leading zeros or remove leading zeros to group into sets of three binary digits.
Binary: 1010001011011110 = 001 010 001 011 011 110
Then, look up each group in a table:
Binary:	000	001	010	011	100	101	110	111	
Octal:	0	1	2	3	4	5	6	7	

Binary =	001	010	001	011	011	110		
Octal =	1	2	1	3	3	6	= 121336 octal	
Therefore, through a two-step conversion process, hexadecimal A2DE equals binary 1010001011011110 equals octal 121336.
Hexadecimal to Decimal
Converting hexadecimal to decimal can be performed in the conventional mathematical way, by showing each digit place as an increasing power of 16. Of course, hexadecimal letter values need to be converted to decimal values before performing the math. 
Hexadecimal:	0	1	2	3	4	5	6	7	
Decimal:	0	1	2	3	4	5	6	7	
Hexadecimal:	8	9	A	B	C	D	E	F	
Decimal:	8	9	10	11	12	13	14	15	

A2DE hexadecimal:
= ((A) * 163) + (2 * 162) + ((D) * 161) + ((E) * 160)
 (10 * 163) + (2 * 162) + (13 * 161) + (14 * 160)
 (10 * 4096) + (2 * 256) + (13 * 16) + (14 * 1)
40960 + 512 + 208 + 14
 41694 decimal
Finally, why you might choose one number system over another...

 This was the end of all conversions.
 Now a little help or guide from GDS group.

Selecting the best number system
The appropriate numbering system to represent a value depends on the application. There are advantages and disadvantages to each numbering system. 
When interfacing with non-engineers, decimal remains the numbering system of choice. For example, I'd have heart attack if the IRS told me that I owed them 1000000 dollars, when they actually meant to say 64 decimal. 
Modern computers have lots of memory and disk space for programs. However, many low-end microcontrollers can be quite tight on space. Outputting a decimal value to a serial port or display requires the number be divided by 10 to break off each digit. Depending on the capabilities of the microcontroller, the divide-by-ten routine alone can take up more room than an entire hexadecimal output routine! 
When diagnosing an output pin logic problem, it isn't immediately helpful to see that the microcontroller's port B is set to 180 decimal. I'd prefer to see the pins as 10110100 binary. The same thing is true when looking at bit flags in memory. A disadvantage of binary is that it gets lengthy fairly quickly. 
When debugging dumps of memory, disks, or data streams on modern microcontroller and computers, hexadecimal provides a compact format that is easy to break into bytes and convert into bits. In my software career, I routine examine lengthy log files detailing all the bytes sent over the air on the wireless networks. 
Octal has fallen out of usage over the last thirty years due to microprocessors and microcontrollers processing data in bit chunks that are not evenly divisible by 3 (4-bit, 8-bit, 16-bit, 32-bit, 64-bit) . Octal does have the advantage of requiring only number symbols (0-8), as opposed to hexadecimal (0-9, A-F). So, octal still finds some limited usage on numeric-only displays. 
To summarize, I switch between using binary, decimal, and hexadecimal on a regular basis, depending which format most clearly expresses the data that the number represents.